-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.html
More file actions
332 lines (300 loc) · 21.3 KB
/
index.html
File metadata and controls
332 lines (300 loc) · 21.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>C++ Network Library — cpp-netlib v0.9 documentation</title>
<link rel="stylesheet" href="_static/cpp-netlib.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '0.9',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="cpp-netlib v0.9 documentation" href="#" />
<link rel="next" title="What’s New" href="whats_new.html" />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-19815738-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<div class="document">
<div id="custom-doc" class="yui-t4">
<div id="hd">
<h1><a href="#">cpp-netlib v0.9 documentation</a></h1>
<div class="nav">
<a title="cpp-netlib v0.9 documentation" href="#" accesskey="U">up</a>
|
<a href="whats_new.html" title="What&#8217;s New">next</a> »</div>
</div>
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<div class="yui-g" id="index">
<div class="section" id="c-network-library">
<h1>C++ Network Library<a class="headerlink" href="#c-network-library" title="Permalink to this headline">¶</a></h1>
<img alt="_images/boost7.png" class="align-right" src="_images/boost7.png" />
<div class="section" id="welcome">
<h2>Welcome<a class="headerlink" href="#welcome" title="Permalink to this headline">¶</a></h2>
<p>The <tt class="xref py py-mod docutils literal"><span class="pre">cpp-netlib</span></tt> is a library that provides application layer
protocol support using modern C++ techniques. It is light-weight,
fast, cross-platform and is intended to be as easy to configure as
possible.</p>
<p>It is developed by people linked to the <a class="reference external" href="http://www.boost.org/">Boost</a> community and will at
some point in the future be submitted for review into Boost. A
presentation about <tt class="xref py py-mod docutils literal"><span class="pre">cpp-netlib</span></tt> was given at <a class="reference external" href="http://www.boostcon.com/">BoostCon 2010</a>,
for which the <a class="reference external" href="http://www.filetolink.com/b0e89d06">slides</a> and the <a class="reference external" href="http://github.com/downloads/mikhailberis/cpp-netlib-boostcon-paper/cpp-netlib.pdf">paper</a> can be found on-line.</p>
</div>
<div class="section" id="sneak-peek">
<h2>Sneak Peek<a class="headerlink" href="#sneak-peek" title="Permalink to this headline">¶</a></h2>
<p>The <tt class="xref py py-mod docutils literal"><span class="pre">cpp-netlib</span></tt> allows you to write semantically consistent code for
making different kinds of higher level network applications.</p>
<p>The library allows for writing simple code for simple C++ HTTP client
applications:</p>
<div class="highlight-c++"><div class="highlight"><pre><span class="k">using</span> <span class="k">namespace</span> <span class="n">boost</span><span class="o">::</span><span class="n">network</span><span class="p">;</span>
<span class="k">using</span> <span class="k">namespace</span> <span class="n">boost</span><span class="o">::</span><span class="n">network</span><span class="o">::</span><span class="n">http</span><span class="p">;</span>
<span class="n">client</span><span class="o">::</span><span class="n">request</span> <span class="n">request_</span><span class="p">(</span><span class="s">"http://www.boost.org/"</span><span class="p">);</span>
<span class="n">request_</span> <span class="o"><<</span> <span class="n">header</span><span class="p">(</span><span class="s">"Connection"</span><span class="p">,</span> <span class="s">"close"</span><span class="p">);</span>
<span class="n">client</span> <span class="n">client_</span><span class="p">;</span>
<span class="n">client</span><span class="o">::</span><span class="n">response</span> <span class="n">response_</span> <span class="o">=</span> <span class="n">client_</span><span class="p">.</span><span class="n">get</span><span class="p">(</span><span class="n">request</span><span class="p">);</span>
<span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">body</span> <span class="o">=</span> <span class="n">body</span><span class="p">(</span><span class="n">response_</span><span class="p">);</span>
</pre></div>
</div>
<p>The library also allows for writing simple C++ HTTP servers:</p>
<div class="highlight-c++"><div class="highlight"><pre><span class="k">namespace</span> <span class="n">http</span> <span class="o">=</span> <span class="n">boost</span><span class="o">::</span><span class="n">network</span><span class="o">::</span><span class="n">http</span><span class="p">;</span>
<span class="k">struct</span> <span class="n">handler</span><span class="p">;</span>
<span class="k">typedef</span> <span class="n">http</span><span class="o">::</span><span class="n">server</span><span class="o"><</span><span class="n">handler</span><span class="o">></span> <span class="n">http_server</span><span class="p">;</span>
<span class="k">struct</span> <span class="n">handler</span> <span class="p">{</span>
<span class="kt">void</span> <span class="k">operator</span><span class="p">()</span> <span class="p">(</span><span class="n">http_server</span><span class="o">::</span><span class="n">request</span> <span class="k">const</span> <span class="o">&</span> <span class="n">request_</span><span class="p">,</span>
<span class="n">http_server</span><span class="o">::</span><span class="n">response</span> <span class="o">&</span> <span class="n">response_</span><span class="p">)</span> <span class="p">{</span>
<span class="n">response</span> <span class="o">=</span> <span class="n">http_server</span><span class="o">::</span><span class="n">response</span><span class="o">::</span><span class="n">stock_reply</span><span class="p">(</span>
<span class="n">http_server</span><span class="o">::</span><span class="n">response</span><span class="o">::</span><span class="n">ok</span><span class="p">,</span> <span class="s">"Hello, world!"</span><span class="p">);</span>
<span class="p">}</span>
<span class="kt">void</span> <span class="n">log</span><span class="p">(</span><span class="n">http_server</span><span class="o">::</span><span class="n">string_type</span> <span class="k">const</span> <span class="o">&</span> <span class="n">info</span><span class="p">)</span> <span class="p">{</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="o"><<</span> <span class="s">"ERROR: "</span> <span class="o"><<</span> <span class="n">info</span> <span class="o"><<</span> <span class="sc">'\n'</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">};</span>
<span class="kt">int</span> <span class="n">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">arg</span><span class="p">,</span> <span class="kt">char</span> <span class="o">*</span> <span class="n">argv</span><span class="p">[])</span> <span class="p">{</span>
<span class="n">handler</span> <span class="n">handler_</span><span class="p">;</span>
<span class="n">http_server</span> <span class="n">server_</span><span class="p">(</span><span class="s">"0.0.0.0"</span><span class="p">,</span> <span class="s">"8000"</span><span class="p">,</span> <span class="n">handler_</span><span class="p">);</span>
<span class="n">server_</span><span class="p">.</span><span class="n">run</span><span class="p">();</span>
<span class="p">}</span>
</pre></div>
</div>
<p>The <tt class="xref py py-mod docutils literal"><span class="pre">cpp-netlib</span></tt> is being developed for eventual submission to <a class="reference external" href="http://www.boost.org/">Boost</a>.</p>
</div>
<div class="section" id="download">
<h2>Download<a class="headerlink" href="#download" title="Permalink to this headline">¶</a></h2>
<p>You can download the latest releases of the library at:</p>
<blockquote>
<div><a class="reference external" href="http://github.com/cpp-netlib/cpp-netlib/downloads">http://github.com/cpp-netlib/cpp-netlib/downloads</a></div></blockquote>
<p>You can also get the latest developments from the <a class="reference external" href="http://git-scm.com/">Git</a> repository at:</p>
<blockquote>
<div>git://github.com/mikhailberis/cpp-netlib.git</div></blockquote>
<p>You can find more information about the progress of the development by checking
the <a class="reference external" href="http://github.com/">GitHub</a> project page at:</p>
<blockquote>
<div><a class="reference external" href="http://github.com/cpp-netlib/cpp-netlib">http://github.com/cpp-netlib/cpp-netlib</a></div></blockquote>
</div>
<div class="section" id="support">
<h2>Support<a class="headerlink" href="#support" title="Permalink to this headline">¶</a></h2>
<p>You can ask questions, join the discussion, and report issues to the developers
mailing list by joining via:</p>
<blockquote>
<div><a class="reference external" href="https://lists.sourceforge.net/lists/listinfo/cpp-netlib-devel">https://lists.sourceforge.net/lists/listinfo/cpp-netlib-devel</a></div></blockquote>
<p>You may also file issues on the <a class="reference external" href="http://github.com/">Github</a> issue tracker at:</p>
<blockquote>
<div><a class="reference external" href="http://github.com/cpp-netlib/cpp-netlib/issues">http://github.com/cpp-netlib/cpp-netlib/issues</a></div></blockquote>
</div>
<div class="section" id="contents">
<h2>Contents<a class="headerlink" href="#contents" title="Permalink to this headline">¶</a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="whats_new.html">What’s New</a><ul>
<li class="toctree-l2"><a class="reference internal" href="whats_new.html#cpp-netlib-0-9"><tt class="docutils literal"><span class="pre">cpp-netlib</span></tt> 0.9</a></li>
<li class="toctree-l2"><a class="reference internal" href="whats_new.html#cpp-netlib-0-8"><tt class="docutils literal"><span class="pre">cpp-netlib</span></tt> 0.8</a></li>
<li class="toctree-l2"><a class="reference internal" href="whats_new.html#cpp-netlib-0-7"><tt class="docutils literal"><span class="pre">cpp-netlib</span></tt> 0.7</a></li>
<li class="toctree-l2"><a class="reference internal" href="whats_new.html#cpp-netlib-0-6"><tt class="docutils literal"><span class="pre">cpp-netlib</span></tt> 0.6</a></li>
<li class="toctree-l2"><a class="reference internal" href="whats_new.html#cpp-netlib-0-5"><tt class="docutils literal"><span class="pre">cpp-netlib</span></tt> 0.5</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="getting_started.html">Getting Started</a><ul>
<li class="toctree-l2"><a class="reference internal" href="getting_started.html#downloading-an-official-release">Downloading an official release</a></li>
<li class="toctree-l2"><a class="reference internal" href="getting_started.html#downloading-a-development-version">Downloading a development version</a></li>
<li class="toctree-l2"><a class="reference internal" href="getting_started.html#getting-boost">Getting Boost</a></li>
<li class="toctree-l2"><a class="reference internal" href="getting_started.html#getting-cmake">Getting CMake</a></li>
<li class="toctree-l2"><a class="reference internal" href="getting_started.html#building-with-cmake">Building with CMake</a><ul>
<li class="toctree-l3"><a class="reference internal" href="getting_started.html#building-on-linux">Building on Linux</a></li>
<li class="toctree-l3"><a class="reference internal" href="getting_started.html#building-on-windows">Building On Windows</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="getting_started.html#reporting-issues-getting-support">Reporting Issues, Getting Support</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="examples.html">Examples</a><ul>
<li class="toctree-l2"><a class="reference internal" href="examples_http.html">HTTP examples</a><ul>
<li class="toctree-l3"><a class="reference internal" href="http_client.html">HTTP client</a></li>
<li class="toctree-l3"><a class="reference internal" href="hello_world_server.html">“Hello world” HTTP server</a></li>
<li class="toctree-l3"><a class="reference internal" href="hello_world_client.html">“Hello world” HTTP client</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="in_depth.html">An in-depth look at the <tt class="docutils literal"><span class="pre">cpp-netlib</span></tt></a><ul>
<li class="toctree-l2"><a class="reference internal" href="message.html">The message template</a><ul>
<li class="toctree-l3"><a class="reference internal" href="message.html#message-concept">Message Concept</a></li>
<li class="toctree-l3"><a class="reference internal" href="message.html#directives-modifiers-and-wrappers">Directives, Modifiers, and Wrappers</a></li>
<li class="toctree-l3"><a class="reference internal" href="message.html#basic-message"><tt class="docutils literal"><span class="pre">basic_message</span></tt></a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="uri.html">The URI template</a><ul>
<li class="toctree-l3"><a class="reference internal" href="uri.html#generic-uri-syntax-overview">Generic URI Syntax Overview</a></li>
<li class="toctree-l3"><a class="reference internal" href="uri.html#basic-uri"><tt class="docutils literal"><span class="pre">basic_uri</span></tt></a></li>
<li class="toctree-l3"><a class="reference internal" href="uri.html#uri-concept"><tt class="docutils literal"><span class="pre">URI</span> <span class="pre">Concept</span></tt></a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="http.html">HTTP implementation</a><ul>
<li class="toctree-l3"><a class="reference internal" href="http.html#http-client">HTTP client</a></li>
<li class="toctree-l3"><a class="reference internal" href="http.html#http-server">HTTP server</a></li>
<li class="toctree-l3"><a class="reference internal" href="http.html#http-uri">HTTP URI</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="techniques.html">Techniques</a><ul>
<li class="toctree-l2"><a class="reference internal" href="tag_metafunctions.html">Tag metafunctions</a><ul>
<li class="toctree-l3"><a class="reference internal" href="tag_metafunctions.html#template-specialization">Template Specialization</a></li>
<li class="toctree-l3"><a class="reference internal" href="tag_metafunctions.html#template-metaprogramming">Template Metaprogramming</a></li>
<li class="toctree-l3"><a class="reference internal" href="tag_metafunctions.html#using-tags">Using Tags</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="directives.html">Directives</a></li>
<li class="toctree-l2"><a class="reference internal" href="polymorphism.html">Static and dynamic polymorphism</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="history.html">Project history</a><ul>
<li class="toctree-l2"><a class="reference internal" href="history.html#motivation">Motivation</a></li>
<li class="toctree-l2"><a class="reference internal" href="history.html#objectives">Objectives</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="install.html">Full installation guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="reference.html">Reference Manual</a><ul>
<li class="toctree-l2"><a class="reference internal" href="reference_http_client.html">HTTP Client API</a><ul>
<li class="toctree-l3"><a class="reference internal" href="reference_http_client.html#general">General</a></li>
<li class="toctree-l3"><a class="reference internal" href="reference_http_client.html#implementations">Implementations</a></li>
<li class="toctree-l3"><a class="reference internal" href="reference_http_client.html#member-functions">Member Functions</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="reference_http_request.html">HTTP Request</a><ul>
<li class="toctree-l3"><a class="reference internal" href="reference_http_request.html#request-concepts">Request Concepts</a></li>
<li class="toctree-l3"><a class="reference internal" href="reference_http_request.html#directives">Directives</a></li>
<li class="toctree-l3"><a class="reference internal" href="reference_http_request.html#modifiers">Modifiers</a></li>
<li class="toctree-l3"><a class="reference internal" href="reference_http_request.html#wrappers">Wrappers</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="reference_http_response.html">HTTP Response</a><ul>
<li class="toctree-l3"><a class="reference internal" href="reference_http_response.html#response-concept">Response Concept</a></li>
<li class="toctree-l3"><a class="reference internal" href="reference_http_response.html#directives">Directives</a></li>
<li class="toctree-l3"><a class="reference internal" href="reference_http_response.html#modifiers">Modifiers</a></li>
<li class="toctree-l3"><a class="reference internal" href="reference_http_response.html#wrappers">Wrappers</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="reference_http_server.html">HTTP Server API</a><ul>
<li class="toctree-l3"><a class="reference internal" href="reference_http_server.html#general">General</a></li>
<li class="toctree-l3"><a class="reference internal" href="reference_http_server.html#implementations">Implementations</a></li>
<li class="toctree-l3"><a class="reference internal" href="reference_http_server.html#synchronous-servers">Synchronous Servers</a></li>
<li class="toctree-l3"><a class="reference internal" href="reference_http_server.html#asynchronous-servers">Asynchronous Servers</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="references.html">References</a><ul>
<li class="toctree-l2"><a class="reference internal" href="references.html#about-cpp-netlib">About <tt class="docutils literal"><span class="pre">cpp-netlib</span></tt></a></li>
<li class="toctree-l2"><a class="reference internal" href="references.html#other-sources">Other sources</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="yui-b" id="sidebar">
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="#">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">C++ Network Library</a><ul>
<li><a class="reference internal" href="#welcome">Welcome</a></li>
<li><a class="reference internal" href="#sneak-peek">Sneak Peek</a></li>
<li><a class="reference internal" href="#download">Download</a></li>
<li><a class="reference internal" href="#support">Support</a></li>
<li><a class="reference internal" href="#contents">Contents</a><ul>
</ul>
</li>
</ul>
</li>
</ul>
<h3>Browse</h3>
<ul>
<li>Next: <a href="whats_new.html">What’s New</a></li>
</ul>
<h3>You are here:</h3>
<ul>
<li>
<a href="#">cpp-netlib v0.9 documentation</a>
<ul><li>C++ Network Library</li></ul>
</li>
</ul>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/index.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" size="18" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
</div>
</div>
<div id="ft">
<div class="nav">
<a title="cpp-netlib v0.9 documentation" href="#" accesskey="U">up</a>
|
<a href="whats_new.html" title="What&#8217;s New">next</a> »</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
documentation automatically generated by <a href="http://sphinx.pocoo.org">Sphinx</a> | style mostly stolen from <a href="http://lettuce.it">lettuce.it</a>
| background image attributed to <a href="http://www.flickr.com/photos/OrangeSmell">OrangeSmell</a>
</div>
</body>
</html>