3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>C++11 Examples</title>
5 <link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
7 <link rel="home" href="../../boost_asio.html" title="Boost.Asio">
8 <link rel="up" href="../examples.html" title="Examples">
9 <link rel="prev" href="cpp03_examples.html" title="C++03 Examples">
10 <link rel="next" href="../reference.html" title="Reference">
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr>
14 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
15 <td align="center"><a href="../../../../index.html">Home</a></td>
16 <td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
17 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19 <td align="center"><a href="../../../../more/index.htm">More</a></td>
22 <div class="spirit-nav">
23 <a accesskey="p" href="cpp03_examples.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../examples.html"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../boost_asio.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../reference.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
26 <div class="titlepage"><div><div><h3 class="title">
27 <a name="boost_asio.examples.cpp11_examples"></a><a class="link" href="cpp11_examples.html" title="C++11 Examples">C++11 Examples</a>
28 </h3></div></div></div>
30 <a name="boost_asio.examples.cpp11_examples.h0"></a>
31 <span class="phrase"><a name="boost_asio.examples.cpp11_examples.allocation"></a></span><a class="link" href="cpp11_examples.html#boost_asio.examples.cpp11_examples.allocation">Allocation</a>
34 This example shows how to customise the allocation of memory associated with
35 asynchronous operations.
37 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
38 <a href="../example/cpp11/allocation/server.cpp" target="_top">boost_asio/example/cpp11/allocation/server.cpp</a>
41 <a name="boost_asio.examples.cpp11_examples.h1"></a>
42 <span class="phrase"><a name="boost_asio.examples.cpp11_examples.buffers"></a></span><a class="link" href="cpp11_examples.html#boost_asio.examples.cpp11_examples.buffers">Buffers</a>
45 This example demonstrates how to create reference counted buffers that can
46 be used with socket read and write operations.
48 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
49 <a href="../example/cpp11/buffers/reference_counted.cpp" target="_top">boost_asio/example/cpp11/buffers/reference_counted.cpp</a>
52 <a name="boost_asio.examples.cpp11_examples.h2"></a>
53 <span class="phrase"><a name="boost_asio.examples.cpp11_examples.chat"></a></span><a class="link" href="cpp11_examples.html#boost_asio.examples.cpp11_examples.chat">Chat</a>
56 This example implements a chat server and client. The programs use a custom
57 protocol with a fixed length message header and variable length message body.
59 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
61 <a href="../example/cpp11/chat/chat_message.hpp" target="_top">boost_asio/example/cpp11/chat/chat_message.hpp</a>
64 <a href="../example/cpp11/chat/chat_client.cpp" target="_top">boost_asio/example/cpp11/chat/chat_client.cpp</a>
67 <a href="../example/cpp11/chat/chat_server.cpp" target="_top">boost_asio/example/cpp11/chat/chat_server.cpp</a>
71 <a name="boost_asio.examples.cpp11_examples.h3"></a>
72 <span class="phrase"><a name="boost_asio.examples.cpp11_examples.echo"></a></span><a class="link" href="cpp11_examples.html#boost_asio.examples.cpp11_examples.echo">Echo</a>
75 A collection of simple clients and servers, showing the use of both synchronous
76 and asynchronous operations.
78 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
80 <a href="../example/cpp11/echo/async_tcp_echo_server.cpp" target="_top">boost_asio/example/cpp11/echo/async_tcp_echo_server.cpp</a>
83 <a href="../example/cpp11/echo/async_udp_echo_server.cpp" target="_top">boost_asio/example/cpp11/echo/async_udp_echo_server.cpp</a>
86 <a href="../example/cpp11/echo/blocking_tcp_echo_client.cpp" target="_top">boost_asio/example/cpp11/echo/blocking_tcp_echo_client.cpp</a>
89 <a href="../example/cpp11/echo/blocking_tcp_echo_server.cpp" target="_top">boost_asio/example/cpp11/echo/blocking_tcp_echo_server.cpp</a>
92 <a href="../example/cpp11/echo/blocking_udp_echo_client.cpp" target="_top">boost_asio/example/cpp11/echo/blocking_udp_echo_client.cpp</a>
95 <a href="../example/cpp11/echo/blocking_udp_echo_server.cpp" target="_top">boost_asio/example/cpp11/echo/blocking_udp_echo_server.cpp</a>
99 <a name="boost_asio.examples.cpp11_examples.h4"></a>
100 <span class="phrase"><a name="boost_asio.examples.cpp11_examples.futures"></a></span><a class="link" href="cpp11_examples.html#boost_asio.examples.cpp11_examples.futures">Futures</a>
103 This example demonstrates how to use std::future in conjunction with Boost.Asio's
104 asynchronous operations.
106 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
107 <a href="../example/cpp11/futures/daytime_client.cpp" target="_top">boost_asio/example/cpp11/futures/daytime_client.cpp</a>
110 <a name="boost_asio.examples.cpp11_examples.h5"></a>
111 <span class="phrase"><a name="boost_asio.examples.cpp11_examples.http_server"></a></span><a class="link" href="cpp11_examples.html#boost_asio.examples.cpp11_examples.http_server">HTTP
115 This example illustrates the use of asio in a simple single-threaded server
116 implementation of HTTP 1.0. It demonstrates how to perform a clean shutdown
117 by cancelling all outstanding asynchronous operations.
119 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
120 <li class="listitem">
121 <a href="../example/cpp11/http/server/connection.cpp" target="_top">boost_asio/example/cpp11/http/server/connection.cpp</a>
123 <li class="listitem">
124 <a href="../example/cpp11/http/server/connection.hpp" target="_top">boost_asio/example/cpp11/http/server/connection.hpp</a>
126 <li class="listitem">
127 <a href="../example/cpp11/http/server/connection_manager.cpp" target="_top">boost_asio/example/cpp11/http/server/connection_manager.cpp</a>
129 <li class="listitem">
130 <a href="../example/cpp11/http/server/connection_manager.hpp" target="_top">boost_asio/example/cpp11/http/server/connection_manager.hpp</a>
132 <li class="listitem">
133 <a href="../example/cpp11/http/server/header.hpp" target="_top">boost_asio/example/cpp11/http/server/header.hpp</a>
135 <li class="listitem">
136 <a href="../example/cpp11/http/server/main.cpp" target="_top">boost_asio/example/cpp11/http/server/main.cpp</a>
138 <li class="listitem">
139 <a href="../example/cpp11/http/server/mime_types.cpp" target="_top">boost_asio/example/cpp11/http/server/mime_types.cpp</a>
141 <li class="listitem">
142 <a href="../example/cpp11/http/server/mime_types.hpp" target="_top">boost_asio/example/cpp11/http/server/mime_types.hpp</a>
144 <li class="listitem">
145 <a href="../example/cpp11/http/server/reply.cpp" target="_top">boost_asio/example/cpp11/http/server/reply.cpp</a>
147 <li class="listitem">
148 <a href="../example/cpp11/http/server/reply.hpp" target="_top">boost_asio/example/cpp11/http/server/reply.hpp</a>
150 <li class="listitem">
151 <a href="../example/cpp11/http/server/request.hpp" target="_top">boost_asio/example/cpp11/http/server/request.hpp</a>
153 <li class="listitem">
154 <a href="../example/cpp11/http/server/request_handler.cpp" target="_top">boost_asio/example/cpp11/http/server/request_handler.cpp</a>
156 <li class="listitem">
157 <a href="../example/cpp11/http/server/request_handler.hpp" target="_top">boost_asio/example/cpp11/http/server/request_handler.hpp</a>
159 <li class="listitem">
160 <a href="../example/cpp11/http/server/request_parser.cpp" target="_top">boost_asio/example/cpp11/http/server/request_parser.cpp</a>
162 <li class="listitem">
163 <a href="../example/cpp11/http/server/request_parser.hpp" target="_top">boost_asio/example/cpp11/http/server/request_parser.hpp</a>
165 <li class="listitem">
166 <a href="../example/cpp11/http/server/server.cpp" target="_top">boost_asio/example/cpp11/http/server/server.cpp</a>
168 <li class="listitem">
169 <a href="../example/cpp11/http/server/server.hpp" target="_top">boost_asio/example/cpp11/http/server/server.hpp</a>
173 <a name="boost_asio.examples.cpp11_examples.h6"></a>
174 <span class="phrase"><a name="boost_asio.examples.cpp11_examples.spawn"></a></span><a class="link" href="cpp11_examples.html#boost_asio.examples.cpp11_examples.spawn">Spawn</a>
177 Example of using the boost::asio::spawn() function, a wrapper around the
178 <a href="http://www.boost.org/doc/libs/release/libs/coroutine/index.html" target="_top">Boost.Coroutine</a>
179 library, to implement a chain of asynchronous operations using stackful coroutines.
181 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
182 <a href="../example/cpp11/spawn/echo_server.cpp" target="_top">boost_asio/example/cpp11/spawn/echo_server.cpp</a>
185 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
186 <td align="left"></td>
187 <td align="right"><div class="copyright-footer">Copyright © 2003-2014 Christopher M. Kohlhoff<p>
188 Distributed under the Boost Software License, Version 1.0. (See accompanying
189 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
194 <div class="spirit-nav">
195 <a accesskey="p" href="cpp03_examples.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../examples.html"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../boost_asio.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../reference.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>