1
-
2
-
3
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
2
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
3
6
4
< html xmlns ="http://www.w3.org/1999/xhtml ">
7
5
< head >
8
6
< meta http-equiv ="Content-Type "content ="text/html; charset=utf-8 "/>
9
-
10
- < title > Getting cpp-netlib — cpp-netlib v0.9.4</ title >
11
- < link rel ="stylesheet "href ="_static/cpp-netlib.css "type ="text/css "/>
12
- < link rel ="stylesheet "href ="_static/pygments.css "type ="text/css "/>
13
- < script type ="text/javascript ">
14
- var DOCUMENTATION_OPTIONS = {
15
- URL_ROOT :'' ,
16
- VERSION :'0.9.4' ,
17
- COLLAPSE_INDEX :false ,
18
- FILE_SUFFIX :'.html' ,
19
- HAS_SOURCE :true
20
- } ;
21
- </ script >
22
- < script type ="text/javascript "src ="_static/jquery.js "> </ script >
23
- < script type ="text/javascript "src ="_static/underscore.js "> </ script >
24
- < script type ="text/javascript "src ="_static/doctools.js "> </ script >
25
- < link rel ="top "title ="cpp-netlib v0.9.4 "href ="# "/>
26
- < script type ="text/javascript ">
27
-
28
- var _gaq = _gaq || [ ] ;
29
- _gaq . push ( [ '_setAccount' , 'UA-19815738-1' ] ) ;
30
- _gaq . push ( [ '_trackPageview' ] ) ;
31
-
32
- ( function ( ) {
33
- var ga = document . createElement ( 'script' ) ; ga . type = 'text/javascript' ; ga . async = true ;
34
- ga . src = ( 'https:' == document . location . protocol ?'https://ssl' :'http://www' ) + '.google-analytics.com/ga.js' ;
35
- var s = document . getElementsByTagName ( 'script' ) [ 0 ] ; s . parentNode . insertBefore ( ga , s ) ;
36
- } ) ( ) ;
37
-
38
- </ script >
39
-
7
+ < meta http-equiv ="refresh "content ="0; URL=latest/index.html "/>
40
8
</ head >
41
- < body >
42
-
43
- < div class ="document ">
44
- < div id ="custom-doc "class ="">
45
- < div id ="hd ">
46
- < h1 > < a href ="# "> cpp-netlib v0.9.4</ a > </ h1 >
47
- < div id ="global-nav ">
48
- < a title ="Home page "href ="# "> Home</ a > |
49
- < a title ="Table of contents "href ="contents.html "> Table of contents</ a > |
50
- < a title ="What's new "href ="whats_new.html "> What's new</ a > |
51
- < a title ="Getting started "href ="getting_started.html "> Getting started</ a > |
52
- < a title ="Examples "href ="examples.html "> Examples</ a > |
53
- < a title ="In depth "href ="in_depth.html "> In depth</ a > |
54
- < a title ="Reference "href ="reference.html "> Reference</ a >
55
- </ div >
56
- < div class ="nav ">
57
- < a title ="cpp-netlib v0.9.4 "href ="# "accesskey ="U "> up</ a > </ div >
58
- </ div >
59
-
60
- < div id ="bd ">
61
- < div id ="yui-main ">
62
- < div class ="yui-b ">
63
- < div class ="yui-g "id ="index ">
64
-
65
- < p class ="rubric "id ="index "> Straightforward network programming in modern C++</ p >
66
- < div class ="section "id ="cpp-netlib-getting-cpp-netlib ">
67
- < h1 > Getting cpp-netlib< a class ="headerlink "href ="#cpp-netlib-getting-cpp-netlib "title ="Permalink to this headline "> ¶</ a > </ h1 >
68
- < p > < strong > Download</ strong > </ p >
69
- < p > You can download the latest releases of the library at:</ p >
70
- < blockquote >
71
- < 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 >
72
- < p > You can find more information about the progress of the development by
73
- checking our< a class ="reference external "href ="http://github.com/ "> GitHub</ a > project page at:</ p >
74
- < blockquote >
75
- < div > < a class ="reference external "href ="http://github.com/cpp-netlib/cpp-netlib "> http://github.com/cpp-netlib/cpp-netlib</ a > </ div > </ blockquote >
76
- < p > < strong > Support</ strong > </ p >
77
- < p > You can ask questions, join the discussion, and report issues to the
78
- developers mailing list by joining via:</ p >
79
- < blockquote >
80
- < div > < a class ="reference external "href ="https://groups.google.com/group/cpp-netlib "> https://groups.google.com/group/cpp-netlib</ a > </ div > </ blockquote >
81
- < p > You can also file issues on the< a class ="reference external "href ="http://github.com/ "> Github</ a > issue tracker at:</ p >
82
- < blockquote >
83
- < 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 >
84
- < p > We are a growing community and we are happy to accept new
85
- contributions and ideas.</ p >
86
- </ div >
87
- < div class ="section "id ="cpp-netlib-boost ">
88
- < h1 > Boost< a class ="headerlink "href ="#cpp-netlib-boost "title ="Permalink to this headline "> ¶</ a > </ h1 >
89
- < 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 >
90
- < img alt ="_images/boost.png "class ="align-left "src ="_images/boost.png "/>
91
- </ div >
92
- < div class ="section "id ="cpp-netlib-c-network-library ">
93
- < h1 > C++ Network Library< a class ="headerlink "href ="#cpp-netlib-c-network-library "title ="Permalink to this headline "> ¶</ a > </ h1 >
94
- < p > The< tt class ="xref py py-mod docutils literal "> < span class ="pre "> cpp-netlib</ span > </ tt > is a library that provides application layer
95
- protocol support using modern C++ techniques. It is light-weight,
96
- fast, portable and is intended to be as easy to configure as possible.</ p >
97
- < p > It is developed by people linked to the< a class ="reference external "href ="http://www.boost.org/ "> Boost</ a > community and will soon
98
- be submitted for review into Boost. A presentation about
99
- < 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
100
- < 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 >
101
- </ div >
102
- < div class ="section "id ="cpp-netlib-hello-world ">
103
- < h1 > Hello, world!< a class ="headerlink "href ="#cpp-netlib-hello-world "title ="Permalink to this headline "> ¶</ a > </ h1 >
104
- < p > The< tt class ="xref py py-mod docutils literal "> < span class ="pre "> cpp-netlib</ span > </ tt > allows developers to write fast, portable
105
- network applications with the minimum of fuss.</ p >
106
- < p > An HTTP server-client example can be written in tens of lines of code.
107
- The client is as simple as this:</ p >
108
- < 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 >
109
- < 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 >
110
-
111
- < 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://127.0.0.1:8000/"</ span > < span class ="p "> );</ span >
112
- < 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 >
113
- < span class ="n "> client</ span > < span class ="n "> client_</ span > < span class ="p "> ;</ span >
114
- < 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 >
115
- < 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 >
116
- </ pre > </ div >
117
- </ div >
118
- < p > And the corresponding server code is listed below:</ p >
119
- < 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 >
120
-
121
- < span class ="k "> struct</ span > < span class ="n "> handler</ span > < span class ="p "> ;</ span >
122
- < 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 >
123
-
124
- < span class ="k "> struct</ span > < span class ="n "> handler</ span > < span class ="p "> {</ span >
125
- < 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 >
126
- < 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 >
127
- < 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 >
128
- < 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 >
129
- < span class ="p "> }</ span >
130
-
131
- < 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 >
132
- < 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 >
133
- < span class ="p "> }</ span >
134
- < span class ="p "> };</ span >
135
-
136
- < 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 >
137
- < span class ="n "> handler</ span > < span class ="n "> handler_</ span > < span class ="p "> ;</ span >
138
- < 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 >
139
- < span class ="n "> server_</ span > < span class ="p "> .</ span > < span class ="n "> run</ span > < span class ="p "> ();</ span >
140
- < span class ="p "> }</ span >
141
- </ pre > </ div >
142
- </ div >
143
- </ div >
144
- < div class ="section "id ="cpp-netlib-want-to-learn-more ">
145
- < h1 > Want to learn more?< a class ="headerlink "href ="#cpp-netlib-want-to-learn-more "title ="Permalink to this headline "> ¶</ a > </ h1 >
146
- < blockquote >
147
- < div > < ul class ="simple ">
148
- < li > < a class ="reference internal "href ="getting_started.html#getting-started "> < em > Take a look at the getting started guide</ em > </ a > </ li >
149
- < li > < a class ="reference internal "href ="examples.html#examples "> < em > Learn from some simple examples</ em > </ a > </ li >
150
- < li > < a class ="reference internal "href ="whats_new.html#whats-new "> < em > Find out what’s new</ em > </ a > </ li >
151
- < li > < a class ="reference internal "href ="in_depth.html#in-depth "> < em > Study the library in more depth</ em > </ a > </ li >
152
- < li > < a class ="reference internal "href ="reference.html#reference "> < em > Discover more through the full reference</ em > </ a > </ li >
153
- </ ul >
154
- </ div > </ blockquote >
155
- < div class ="admonition warning ">
156
- < p class ="first admonition-title "> Warning</ p >
157
- < p class ="last "> Be aware that not all features are stable. The generic
158
- message design is under review and the URI and HTTP
159
- client implementation will continue to undergo
160
- refactoring. Future versions will include support for
161
- other network protocols.</ p >
162
- </ div >
163
- </ div >
164
9
10
+ < body >
11
+ Automatic redirection failed, please go to< a href "latest/index.html"> index.html</ a > .
165
12
166
- </ div >
167
- </ div >
168
- </ div >
169
-
170
-
171
-
172
- </ div >
13
+ < div class ="copyright-footer ">
14
+ < p > Copyright 2012 Glyn Matthews</ p >
173
15
174
- < div id ="ft ">
175
- < div class ="nav ">
176
- < a title ="cpp-netlib v0.9.4 "href ="# "accesskey ="U "> up</ a > </ div >
16
+ < p > Distributed under the Boost Software License, Version 1.0. (See
17
+ accompanying file< a href ="LICENSE_1_0.txt "> LICENSE_1_0.txt</ a > or copy
18
+ at< a href =
19
+ "http://www.boost.org/LICENSE_1_0.txt "> http://www.boost.org/LICENSE_1_0.txt</ a > )</ p >
177
20
</ div >
178
- </ div >
179
-
180
- < div class ="clearer "> </ div >
181
- </ div >
182
- < div class ="footer ">
183
- documentation automatically generated by< a href ="http://sphinx.pocoo.org "> Sphinx</ a > | style mostly stolen from< a href ="http://lettuce.it "> lettuce.it</ a >
184
- </ div >
185
-
186
21
</ body >
187
- </ html >
22
+ </ html >