### C++11 Examples

##### Allocation

This example shows how to customise the allocation of memory associated with asynchronous operations.

- ../src/examples/cpp11/allocation/server.cpp (diff to C++03)

##### Buffers

This example demonstrates how to create reference counted buffers that can be used with socket read and write operations.

- ../src/examples/cpp11/buffers/reference_counted.cpp (diff to C++03)

##### Chat

This example implements a chat server and client. The programs use a custom protocol with a fixed length message header and variable length message body.

- ../src/examples/cpp11/chat/chat_message.hpp (diff to C++03)
- ../src/examples/cpp11/chat/chat_client.cpp (diff to C++03)
- ../src/examples/cpp11/chat/chat_server.cpp (diff to C++03)

##### Echo

A collection of simple clients and servers, showing the use of both synchronous and asynchronous operations.

- ../src/examples/cpp11/echo/async_tcp_echo_server.cpp (diff to C++03)
- ../src/examples/cpp11/echo/async_udp_echo_server.cpp (diff to C++03)
- ../src/examples/cpp11/echo/blocking_tcp_echo_client.cpp (diff to C++03)
- ../src/examples/cpp11/echo/blocking_tcp_echo_server.cpp (diff to C++03)
- ../src/examples/cpp11/echo/blocking_udp_echo_client.cpp (diff to C++03)
- ../src/examples/cpp11/echo/blocking_udp_echo_server.cpp (diff to C++03)

##### Deferred

Examples showing how to use the `deferred` completion token.

- ../src/examples/cpp11/deferred/deferred_1.cpp
- ../src/examples/cpp11/deferred/deferred_2.cpp

##### Fork

These POSIX-specific examples show how to use Asio in conjunction with the `fork()` system call. The first example illustrates the steps required to start a daemon process:

- ../src/examples/cpp11/fork/daemon.cpp (diff to C++03)

The second example demonstrates how it is possible to fork a process from within a completion handler.

- ../src/examples/cpp11/fork/process_per_connection.cpp (diff to C++03)

##### Futures

This example demonstrates how to use std::future in conjunction with Asio's asynchronous operations.

- ../src/examples/cpp11/futures/daytime_client.cpp

##### Handler Tracking

This example header file shows how to implement custom handler tracking.

- ../src/examples/cpp11/handler_tracking/custom_tracking.hpp

This example program shows how to include source location information in the handler tracking output.

- ../src/examples/cpp11/handler_tracking/async_tcp_echo_server.cpp

##### HTTP Server

This example illustrates the use of asio in a simple single-threaded server implementation of HTTP 1.0. It demonstrates how to perform a clean shutdown by cancelling all outstanding asynchronous operations.

- ../src/examples/cpp11/http/server/connection.cpp (diff to C++03)
- ../src/examples/cpp11/http/server/connection.hpp (diff to C++03)
- ../src/examples/cpp11/http/server/connection_manager.cpp (diff to C++03)
- ../src/examples/cpp11/http/server/connection_manager.hpp (diff to C++03)
- ../src/examples/cpp11/http/server/header.hpp (diff to C++03)
- ../src/examples/cpp11/http/server/main.cpp (diff to C++03)
- ../src/examples/cpp11/http/server/mime_types.cpp (diff to C++03)
- ../src/examples/cpp11/http/server/mime_types.hpp (diff to C++03)
- ../src/examples/cpp11/http/server/reply.cpp (diff to C++03)
- ../src/examples/cpp11/http/server/reply.hpp (diff to C++03)
- ../src/examples/cpp11/http/server/request.hpp (diff to C++03)
- ../src/examples/cpp11/http/server/request_handler.cpp (diff to C++03)
- ../src/examples/cpp11/http/server/request_handler.hpp (diff to C++03)
- ../src/examples/cpp11/http/server/request_parser.cpp (diff to C++03)
- ../src/examples/cpp11/http/server/request_parser.hpp (diff to C++03)
- ../src/examples/cpp11/http/server/server.cpp (diff to C++03)
- ../src/examples/cpp11/http/server/server.hpp (diff to C++03)

##### Multicast

An example showing the use of multicast to transmit packets to a group of subscribers.

- ../src/examples/cpp11/multicast/receiver.cpp (diff to C++03)
- ../src/examples/cpp11/multicast/sender.cpp (diff to C++03)

##### Nonblocking

Example demonstrating reactor-style operations for integrating a third-party library that wants to perform the I/O operations itself.

- ../src/examples/cpp11/nonblocking/third_party_lib.cpp (diff to C++03)

##### Operations

Examples showing how to implement composed asynchronous operations as reusable library functions.

- ../src/examples/cpp11/operations/composed_1.cpp
- ../src/examples/cpp11/operations/composed_2.cpp
- ../src/examples/cpp11/operations/composed_3.cpp
- ../src/examples/cpp11/operations/composed_4.cpp
- ../src/examples/cpp11/operations/composed_5.cpp
- ../src/examples/cpp11/operations/composed_6.cpp
- ../src/examples/cpp11/operations/composed_7.cpp
- ../src/examples/cpp11/operations/composed_8.cpp

##### Parallel Groups

Examples showing how to use the `experimental::make_parallel_group` operation.

- ../src/examples/cpp11/parallel_group/wait_for_all.cpp
- ../src/examples/cpp11/parallel_group/wait_for_one.cpp
- ../src/examples/cpp11/parallel_group/wait_for_one_error.cpp
- ../src/examples/cpp11/parallel_group/wait_for_one_success.cpp
- ../src/examples/cpp11/parallel_group/ranged_wait_for_all.cpp

##### SOCKS 4

Example client program implementing the SOCKS 4 protocol for communication via a proxy.

- ../src/examples/cpp11/socks4/sync_client.cpp (diff to C++03)
- ../src/examples/cpp11/socks4/socks4.hpp (diff to C++03)

##### Spawn

Example of using the asio::spawn() function, a wrapper around the Boost.Coroutine library, to implement a chain of asynchronous operations using stackful coroutines.

- ../src/examples/cpp11/spawn/echo_server.cpp (diff to C++03)

##### SSL

Example client and server programs showing the use of the ssl::stream<> template with asynchronous operations.

- ../src/examples/cpp11/ssl/client.cpp (diff to C++03)
- ../src/examples/cpp11/ssl/server.cpp (diff to C++03)

##### Timeouts

A collection of examples showing how to cancel long running asynchronous operations after a period of time.

- ../src/examples/cpp11/timeouts/async_tcp_client.cpp (diff to C++03)
- ../src/examples/cpp11/timeouts/blocking_tcp_client.cpp (diff to C++03)
- ../src/examples/cpp11/timeouts/blocking_token_tcp_client.cpp (diff to C++03)
- ../src/examples/cpp11/timeouts/blocking_udp_client.cpp (diff to C++03)
- ../src/examples/cpp11/timeouts/server.cpp (diff to C++03)

##### Timers

Example showing how to customise basic_waitable_timer using a different clock type.

- ../src/examples/cpp11/timers/time_t_timer.cpp (diff to C++03)

##### Type Erasure

Example showing how to use `any_completion_handler` to enable separate compilation of asynchronous operations.

- ../src/examples/cpp11/type_erasure/main.cpp
- ../src/examples/cpp11/type_erasure/line_reader.hpp
- ../src/examples/cpp11/type_erasure/stdin_line_reader.hpp
- ../src/examples/cpp11/type_erasure/stdin_line_reader.cpp
- ../src/examples/cpp11/type_erasure/sleep.hpp
- ../src/examples/cpp11/type_erasure/sleep.cpp

##### UNIX Domain Sockets

Examples showing how to use UNIX domain (local) sockets.

- ../src/examples/cpp11/local/connect_pair.cpp (diff to C++03)
- ../src/examples/cpp11/local/iostream_client.cpp (diff to C++03)
- ../src/examples/cpp11/local/stream_server.cpp (diff to C++03)
- ../src/examples/cpp11/local/stream_client.cpp (diff to C++03)
- ../src/examples/cpp11/local/fd_passing_stream_server.cpp
- ../src/examples/cpp11/local/fd_passing_stream_client.cpp