Skip to content

Release documentation #612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libs/network/doc/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: ae0de19b7b7891744d7373f4a9b6c125
tags: fbb0d17656682115ca4d033fb2f83ba1
config: adbe6ea7ac2e69d5b593dfb1e312603d
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file removed libs/network/doc/html/.doctrees/contents.doctree
Binary file not shown.
Binary file removed libs/network/doc/html/.doctrees/environment.pickle
Binary file not shown.
Binary file removed libs/network/doc/html/.doctrees/examples.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed libs/network/doc/html/.doctrees/history.doctree
Binary file not shown.
Binary file removed libs/network/doc/html/.doctrees/in_depth.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed libs/network/doc/html/.doctrees/in_depth/uri.doctree
Binary file not shown.
Binary file removed libs/network/doc/html/.doctrees/index.doctree
Binary file not shown.
Binary file removed libs/network/doc/html/.doctrees/reference.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed libs/network/doc/html/.doctrees/references.doctree
Binary file not shown.
Binary file removed libs/network/doc/html/.doctrees/techniques.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed libs/network/doc/html/.doctrees/whats_new.doctree
Binary file not shown.
Binary file removed libs/network/doc/html/_images/boost.png
Binary file not shown.
54 changes: 31 additions & 23 deletions libs/network/doc/html/_sources/examples/http/hello_world_server.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ simple response to any HTTP request.
.. code-block:: c++

#include <boost/network/protocol/http/server.hpp>
#include <string>
#include <iostream>

namespace http = boost::network::http;
Expand All @@ -28,16 +27,19 @@ simple response to any HTTP request.
typedef http::server<hello_world> server;

struct hello_world {
void operator() (server::request const &request,
server::response &response) {
std::string ip = source(request);
response = server::response::stock_reply(
server::response::ok, std::string("Hello, ") + ip + "!");
void operator()(server::request const &request, server::response &response) {
server::string_type ip = source(request);
unsigned int port = request.source_port;
std::ostringstream data;
data << "Hello, " << ip << ':' << port << '!';
response = server::response::stock_reply(server::response::ok, data.str());
}
void log(const server::string_type& message) {
std::cerr << "ERROR: " << message << std::endl;
}
};

int
main(int argc, char * argv[]) {
int main(int argc, char *argv[]) {

if (argc != 3) {
std::cerr << "Usage: " << argv[0] << " address port" << std::endl;
Expand All @@ -46,7 +48,8 @@ simple response to any HTTP request.

try {
hello_world handler;
server server_(argv[1], argv[2], handler);
server::options options(handler);
server server_(options.address(argv[1]).port(argv[2]));
server_.run();
}
catch (std::exception &e) {
Expand Down Expand Up @@ -100,34 +103,39 @@ This header contains all the code needed to develop an HTTP server with
typedef http::server<hello_world> server;

struct hello_world {
void operator () (server::request const &request,
server::response &response) {
std::string ip = source(request);
response = server::response::stock_reply(
server::response::ok, std::string("Hello, ") + ip + "!");
void operator()(server::request const &request, server::response &response) {
server::string_type ip = source(request);
unsigned int port = request.source_port;
std::ostringstream data;
data << "Hello, " << ip << ':' << port << '!';
response = server::response::stock_reply(server::response::ok, data.str());
}
void log(const server::string_type& message) {
std::cerr << "ERROR: " << message << std::endl;
}
};

``hello_world`` is a functor class which handles HTTP requests. All
the operator does here is return an HTTP response with HTTP code 200
and the body ``"Hello, <ip>!"``. The ``<ip>`` in this case would be
the IP address of the client that made the request.
``hello_world`` is a functor class which handles HTTP requests.
All the operator does here is return an HTTP response with HTTP code 200
and the body ``"Hello, <ip>:<port>!"``. The ``<ip>`` in this case would be
the IP address of the client that made the request and ``<port>`` the clients port.

There are a number of pre-defined stock replies differentiated by
status code with configurable bodies.

All the supported enumeration values for the response status codes can be found
in ``boost/network/protocol/http/impl/response.ipp``.

.. code-block:: c++

hello_world handler;
server server_(argv[1], argv[2], handler);
server::options options(handler);
server server_(options.address(argv[1]).port(argv[2]));
server_.run();

The first two arguments to the ``server`` constructor are the host and
the port on which the server will listen. The third argument is the
the handler object defined previously.
The ``server`` constructor requires an object of the ``options`` class,
this object stores all needed options, especially the host and
the port on which the server will listen.
The ``options`` constructor's single argument is the handler object defined previously.

.. note:: In this example, the server is specifically made to be single-threaded.
In a multi-threaded server, you would invoke the ``hello_world::run`` member
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ The code
`rapidjson`_, a header-only library that is released under
the `MIT License`_.

.. _`rapidjson`: http://code.google.com/p/rapidjson/
.. _`rapidjson`: https://github.com/miloyip/rapidjson
.. _`MIT License`: http://www.opensource.org/licenses/mit-license.php

Building and running ``twitter_search``
Expand Down
18 changes: 18 additions & 0 deletions libs/network/doc/html/_sources/reference/http_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ asynchronous.
As of 0.11 the `Synchronous Clients`_ are now *DEPRECATED* and will be removed
in subsequent releases.

In 0.12.x the `Synchronous Clients`_ have been removed.

Features
--------

Expand Down Expand Up @@ -473,3 +475,19 @@ to create a function object.

The ``BOOST_NETWORK_HTTP_BODY_CALLBACK`` macro is defined in
``boost/network/protocol/http/client/macros.hpp``.

Generated Documentation
-----------------------

.. doxygenclass:: boost::network::http::client_options
:project: cppnetlib
:members:
:undoc-members:

.. doxygenclass:: boost::network::http::basic_client
:project: cppnetlib
:members:
:undoc-members:

.. doxygentypedef:: boost::network::http::client
:project: cppnetlib
21 changes: 21 additions & 0 deletions libs/network/doc/html/_sources/whats_new.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,27 @@
What's New
************

:mod:`cpp-netlib` 0.12
----------------------

* Added a code of conduct.
* Add TLS SNI hostname support in the HTTP Client options.
* Changes based on Coverity reports.
* Replace std::bind with lambdas.
* Use std::shared_ptr instead of boost::shared_ptr.
* Use standalone Asio instead of Boost.Asio.
* No Boost library (shared or static) dependencies.
* Use doxygen for documentation, integrated with Breathe to Sphinx.
* Require C++11 for builds, removes support for non-C++11 compilers.
* Update documentation for hello_world_server
* Use googletest for tests
* Fix XCode-generated debug binaries caused by URI parser complexity
* Remove synchronous client implementation.
* Remove support for connection keepalive (only supported in synchronous client).
* Disable SSLv3 by default.
* Use sanitisers in continuous integration (address and thread sanitiser).
* Update minimum Boost to 1.57. Always use shared libs from Boost.

:mod:`cpp-netlib` 0.11
----------------------

Expand Down
Binary file removed libs/network/doc/html/_static/Button-Info-icon.png
Binary file not shown.
Binary file not shown.
74 changes: 68 additions & 6 deletions libs/network/doc/html/_static/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Sphinx stylesheet -- basic theme.
*
* :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
Expand Down Expand Up @@ -197,7 +197,10 @@ h3:hover > a.headerlink,
h4:hover > a.headerlink,
h5:hover > a.headerlink,
h6:hover > a.headerlink,
dt:hover > a.headerlink {
dt:hover > a.headerlink,
caption:hover > a.headerlink,
p.caption:hover > a.headerlink,
div.code-block-caption:hover > a.headerlink {
visibility: visible;
}

Expand Down Expand Up @@ -314,6 +317,13 @@ table.docutils {
border-collapse: collapse;
}

table caption span.caption-number {
font-style: italic;
}

table caption span.caption-text {
}

table.docutils td, table.docutils th {
padding: 1px 8px 1px 5px;
border-top: 0;
Expand Down Expand Up @@ -344,6 +354,25 @@ table.citation td {
border-bottom: none;
}

/* -- figures --------------------------------------------------------------- */

div.figure {
margin: 0.5em;
padding: 0.5em;
}

div.figure p.caption {
padding: 0.3em;
}

div.figure p.caption span.caption-number {
font-style: italic;
}

div.figure p.caption span.caption-text {
}


/* -- other body styles ----------------------------------------------------- */

ol.arabic {
Expand Down Expand Up @@ -406,6 +435,10 @@ dl.glossary dt {
font-size: 1.3em;
}

.sig-paren {
font-size: larger;
}

.versionmodified {
font-style: italic;
}
Expand Down Expand Up @@ -471,22 +504,51 @@ table.highlighttable td {
padding: 0 0.5em 0 0.5em;
}

tt.descname {
div.code-block-caption {
padding: 2px 5px;
font-size: small;
}

div.code-block-caption code {
background-color: transparent;
}

div.code-block-caption + div > div.highlight > pre {
margin-top: 0;
}

div.code-block-caption span.caption-number {
padding: 0.1em 0.3em;
font-style: italic;
}

div.code-block-caption span.caption-text {
}

div.literal-block-wrapper {
padding: 1em 1em 0;
}

div.literal-block-wrapper div.highlight {
margin: 0;
}

code.descname {
background-color: transparent;
font-weight: bold;
font-size: 1.2em;
}

tt.descclassname {
code.descclassname {
background-color: transparent;
}

tt.xref, a tt {
code.xref, a code {
background-color: transparent;
font-weight: bold;
}

h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
background-color: transparent;
}

Expand Down
Binary file removed libs/network/doc/html/_static/boost.png
Binary file not shown.
Loading