asio C++ library

PrevUpHomeNext

C++11 Examples

Allocation

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

Buffers

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

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.

Echo

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

Deferred

Examples showing how to use the deferred completion token.

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:

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

Futures

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

Handler Tracking

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

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

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.

Multicast

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

Nonblocking

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

Operations

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

Parallel Groups

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

SOCKS 4

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

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.

SSL

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

Timeouts

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

Timers

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

Type Erasure

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

UNIX Domain Sockets

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


PrevUpHomeNext