AllocationThis example shows how to customise the allocation of memory associated with
asynchronous operations.
BuffersThis example demonstrates how to create reference counted buffers that can
be used with socket read and write operations.
ChatThis example implements a chat server and client. The programs use a custom
protocol with a fixed length message header and variable length message body.The following POSIX-specific chat client demonstrates how to use the posix::stream_descriptor
class to perform console input and output.
EchoA collection of simple clients and servers, showing the use of both synchronous
and asynchronous operations.
- boost_asio/example/echo/async_tcp_echo_server.cpp
- boost_asio/example/echo/async_udp_echo_server.cpp
- boost_asio/example/echo/blocking_tcp_echo_client.cpp
- boost_asio/example/echo/blocking_tcp_echo_server.cpp
- boost_asio/example/echo/blocking_udp_echo_client.cpp
- boost_asio/example/echo/blocking_udp_echo_server.cpp
HTTP ClientExample programs implementing simple HTTP 1.0 clients. These examples show
how to use the read_until
and async_read_until
functions.
HTTP ServerThis 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.
- boost_asio/example/http/server/connection.cpp
- boost_asio/example/http/server/connection.hpp
- boost_asio/example/http/server/connection_manager.cpp
- boost_asio/example/http/server/connection_manager.hpp
- boost_asio/example/http/server/header.hpp
- boost_asio/example/http/server/mime_types.cpp
- boost_asio/example/http/server/mime_types.hpp
- boost_asio/example/http/server/posix_main.cpp
- boost_asio/example/http/server/reply.cpp
- boost_asio/example/http/server/reply.hpp
- boost_asio/example/http/server/request.hpp
- boost_asio/example/http/server/request_handler.cpp
- boost_asio/example/http/server/request_handler.hpp
- boost_asio/example/http/server/request_parser.cpp
- boost_asio/example/http/server/request_parser.hpp
- boost_asio/example/http/server/server.cpp
- boost_asio/example/http/server/server.hpp
- boost_asio/example/http/server/win_main.cpp
HTTP Server 2An HTTP server using an io_service-per-CPU design.
- boost_asio/example/http/server2/connection.cpp
- boost_asio/example/http/server2/connection.hpp
- boost_asio/example/http/server2/header.hpp
- boost_asio/example/http/server2/io_service_pool.cpp
- boost_asio/example/http/server2/io_service_pool.hpp
- boost_asio/example/http/server2/mime_types.cpp
- boost_asio/example/http/server2/mime_types.hpp
- boost_asio/example/http/server2/posix_main.cpp
- boost_asio/example/http/server2/reply.cpp
- boost_asio/example/http/server2/reply.hpp
- boost_asio/example/http/server2/request.hpp
- boost_asio/example/http/server2/request_handler.cpp
- boost_asio/example/http/server2/request_handler.hpp
- boost_asio/example/http/server2/request_parser.cpp
- boost_asio/example/http/server2/request_parser.hpp
- boost_asio/example/http/server2/server.cpp
- boost_asio/example/http/server2/server.hpp
- boost_asio/example/http/server2/win_main.cpp
HTTP Server 3An HTTP server using a single io_service and a thread pool calling
io_service::run()
.
- boost_asio/example/http/server3/connection.cpp
- boost_asio/example/http/server3/connection.hpp
- boost_asio/example/http/server3/header.hpp
- boost_asio/example/http/server3/mime_types.cpp
- boost_asio/example/http/server3/mime_types.hpp
- boost_asio/example/http/server3/posix_main.cpp
- boost_asio/example/http/server3/reply.cpp
- boost_asio/example/http/server3/reply.hpp
- boost_asio/example/http/server3/request.hpp
- boost_asio/example/http/server3/request_handler.cpp
- boost_asio/example/http/server3/request_handler.hpp
- boost_asio/example/http/server3/request_parser.cpp
- boost_asio/example/http/server3/request_parser.hpp
- boost_asio/example/http/server3/server.cpp
- boost_asio/example/http/server3/server.hpp
- boost_asio/example/http/server3/win_main.cpp
ICMPThis example shows how to use raw sockets with ICMP to ping a remote host.
InvocationThis example shows how to customise handler invocation. Completion handlers
are added to a priority queue rather than executed immediately.
IostreamsTwo examples showing how to use ip::tcp::iostream.
MulticastAn example showing the use of multicast to transmit packets to a group of subscribers.
SerializationThis example shows how Boost.Serialization can be used with asio to encode
and decode structures for transmission over a socket.
ServicesThis example demonstrates how to integrate custom functionality (in this case,
for logging) into asio's io_service,
and how to use a custom service with basic_stream_socket<>.
SOCKS 4Example client program implementing the SOCKS 4 protocol for communication
via a proxy.
SSLExample client and server programs showing the use of the ssl::stream<>
template with asynchronous operations.
TimeoutsA collection of examples showing how to cancel long running asynchronous operations
after a period of time.
TimersExamples showing how to customise deadline_timer using different time types.
PorthopperExample illustrating mixed synchronous and asynchronous operations, and how
to use Boost.Lambda with Boost.Asio.
NonblockingExample demonstrating reactor-style operations for integrating a third-party
library that wants to perform the I/O operations itself.
UNIX Domain SocketsExamples showing how to use UNIX domain (local) sockets.
WindowsAn example showing how to use the Windows-specific function
TransmitFile
with Boost.Asio.