9
9
use and embed in your own applications. All of the HTTP client implementations:
10
10
11
11
* **Cannot be copied. ** This means you may have to store instances of the
12
- clients in dynamic memory.
12
+ clients in dynamic memory if you intend to use them as function parameters
13
+ or pass them around in smart pointers or by reference.
13
14
* **Assume that requests made are independent of each other. ** There currently
14
15
is no cookie or session management system built-in to cpp-netlib's HTTP client
15
16
implementations.
@@ -46,11 +47,20 @@ the HTTP client implementation provided by :mod:`cpp-netlib`.
46
47
47
48
.. include :: http_client_tags.rst
48
49
50
+ In the above table the tags follow a pattern for describing the behavior
51
+ introduced by the tags. This pattern is shown below:
52
+
53
+ <protocol>_<modifier>_<character-width>_<resolve-strategy>
54
+
55
+ For example, the tag ``http_default_8bit_tcp_resolve `` indicates the protocol
56
+ ``http ``, a modifier ``default ``, a character width of ``8bit ``, and a resolve
57
+ strategy of ``tcp_resolve ``.
58
+
49
59
Synchronous Clients
50
60
~~~~~~~~~~~~~~~~~~~
51
61
52
62
Of the client tags shown in the table, the following makes the ``basic_client ``
53
- behave as a fully synchonous client.
63
+ behave as a fully synchronous client.
54
64
55
65
* **http_default_8bit_tcp_resolve **
56
66
* **http_default_8bit_udp_resolve **
@@ -68,7 +78,29 @@ are encountered in the performance of the HTTP requests.
68
78
Asynchronous Clients
69
79
~~~~~~~~~~~~~~~~~~~~
70
80
71
- .. FIXME show the table of tags that enable the asynchronous implementation.
81
+ The following tags specify the ``basic_client `` to behave in an asynchronous
82
+ manner:
83
+
84
+ * **http_async_8bit_tcp_resolve **
85
+ * **http_async_8bit_udp_resolve **
86
+
87
+ An asynchronous client implementation means that``basic_client<...>`` is an
88
+ `Active Object `_. This means that the client has and manages its own lifetime
89
+ thread, and returns values that are asynchronously filled in. The response
90
+ object encapsulates Boost.Thread _ futures which get filled in once the values
91
+ are available.
92
+
93
+ .. _Boost.Thread : http://www.boost.org/libs/thread
94
+ .. _`Active Object` : http://en.wikipedia.org/wiki/Active_object
95
+
96
+ The asynchronous clients implement all operations asynchronously which are hidden
97
+ from the user. The interface is still synchronous but the fetching of data
98
+ happens on a different thread.
99
+
100
+ .. note :: The asynchronous clients are thread safe, and can be shared across
101
+ many threads. Each request starts a sequence of asynchronous operations
102
+ dedicated to that request. The client does not re-cycle connections and uses
103
+ a one-request-one-connection model.
72
104
73
105
Member Functions
74
106
----------------
0 commit comments