mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-04-24 00:00:05 +08:00
6f1fcb972a
b3d2ab725 asio version 1.12.0 released
d9161a36e Update release script to match new boost doc build.
54c7b85de Update revision history.
9eaa2a2e5 Update tutorial text to use 'io_context'.
41eb9dc20 Ignore tsified directory.
9229964dc Don't use inline namespace 'v1' in example code snippets.
10098abd6 Include inline namespace 'v1' in tsified code.
9bdbef19f Regenerate documentation.
8fa11a15d Exclude use_future_t implementation detail from documentation.
577b69806 Workaround broken doxygen typedef linking when primary template is undefined.
ea1b39f04 Fix tsify.pl to work with latest code.
694ed5284 Document the new concurrency hints.
3834d7363 Some updates to 'Using' notes.
00873ce91 Document Networking TS changes.
8f25ea4b5 Remove spurious value_type from buffer sequence requirements.
b33eb0219 gcc 4.7 is the minimum version required for std::allocator_traits.
036faf66a Use new move-enabled form of async_accept.
f72304319 Ensure that use_future<std::allocator<void>> is always constexpr default-constructible.
4ad7a397c Add missing variadic template emulation in use_future.
5c591a466 Disable buffer debugging for older MSVC, as it triggers compiler misbehaviour.
f8bd903af Add assign() and clear() functions to error_code.
db4c0e83f Disable boost.chrono error handling.
cca13eefa Document the new handler tracking features.
ff9d69e2f Add check for _DEFAULT_SOURCE in addition to _BSD_SOURCE.
52498bbc6 Suppress recv truncation errors on Windows, to match POSIX behaviour.
e87c37ec9 Add documentation examples of using asio::post to submit work.
ad52c82d2 Create C++11 versions of the fork, local, multicast and nonblocking examples.
f16e39e78 Don't directly include <chrono>, to keep header C++03-compatible.
c016e1aec Boostify the TS headers.
559013298 Suppress MSVC dynamic initialisation warning.
efa18153d Add tests to ensure the ts/* headers compile and are self-contained.
41fccd565 asio/use_future.hpp is already in the convenience header.
2e743f737 Add waitable timer headers to convenience header.
fe5470f4f Use new post() in serialization example.
45dcb33c2 Use asio::coroutine in latency tests.
e556aed8d Update invocation examples to use executors.
5a9d0721d Fix up reference to post().
24050d5ea Show how to associate an executor using nested type and member function.
b02c6c758 Update allocation overview and examples to use new form.
3218be74e Fix typo in strands overview.
3152e77f8 Increase number of buffers per operation for consuming_buffers.
5acae1971 Increase threshold for small memory block recycling to 1KB.
986ef7361 Make sure asio/system_context.hpp is self-contained.
c80c1cbd5 Don't call memcpy with length 0, to avoid passing null pointers.
ede4e7597 Fix description of std::getline's behaviour.
60170d625 Fix copy/paste error in comment.
cff2b4998 Fix clang narrowing warning.
a40570919 Fix incorrect hyperlink target.
fcaf75700 Remove last remaining instance of auto_ptr.
fddf89126 Restore binder support for 3, 4 and 5 arguments.
096660c47 Fix double delete issue introduced by 47b9319acbc45d3c1bcb805a4a03cd47df177c11.
b44805ff0 Add backward compatibility for the old ConnectCondition form.
09c69982e Ensure make_network_vX error_code overload doesn't throw on invalid prefix length.
f4fecdfe4 Fix the rights for event objects on UWP.
2943ee65f Suppress implicit fallthrough warning on newer gcc.
b441bf70b Fix clang version detection for suppression of unused typedef warning.
565c6e8fa Fix compile errors in some asio::connect overloads.
d52b81646 Bump minimum MSVC version required for C++11 allocators.
5618fadb1 Fix compile warning under Emscripten
b2367dab2 Use proper SSL_version() function so that asio can build with BoringSSL.
cfe47e71d Regenerate documentation.
6377b0466 Patch up some template links.
2bda4b85c Add new macros to doxygen configuration.
4a4d28b0d Qualify use of error_code.
e39a95a73 Fix boostify.pl to work with latest code.
2ccb648f4 Only obtain associated allocator when handler is known to be valid.
230c0d2ae Asynchronous accept should not check user-set non-blocking flag.
862aed305 Require gcc >= 4.7 to use standard atomics.
a0d28e5a7 Don't use auto_ptr.
15e136fa8 Use deregister_internal_descriptor in signal_set_service.
59330e825 Put detail/config.hpp include first in detail/string_view.hpp.
d6144828b Only enable string_view with /std:c++17 on MSVC.
c2cb5395e Use hook allocation strategy whenever associated allocator is std::allocator.
5b4aa5ef9 Make epoll_reactor resistant to events with duplicate user data.
47b9319ac Don't free the reactor's per-descriptor state until after close.
cbf687653 Fix compile errors in dev_poll_reactor.
870124ab5 Add missing 'else' in epoll_reactor's handler tracking support.
b37b9449e Clean up socket release() implementation for reactor-based platforms.
f5c570826 Add out_of_band_inline socket option.
7f849376c Expose the system_executor's execution context as system_context.
9f62b6791 Update io_context run* documentation.
ac89cf0ba Enable newer language features for recent MSVC versions.
64ae9bcae Add alias templates for associators.
e502a6b36 Use shorter enum name resolver_errc::try_again.
b3ebdd8f6 Use ADL for calls to buffer_size.
c516cd591 Fix non-dereferencing pointer overflow in basic_streambuf::commit.
b8a34a1dc Fix work counting issue in asynchronous resolver implementation.
48e7ef864 is_continuation misplaced in reactive socket service
5adce6e26 Use poll.h rather than sys/poll.h if possible.
ddef4994f Avoid exception throwing from `make_network_v{4,6}(str, ec)`
0442bc922 Disable Boost.Chrono's dependency on Boost.System.
6c5b04eff Conditionally enable iostream move constructor and assignment.
a3bba3394 Fix version check for string_view.
246f387e7 Fix compile error on gcc 4.8.
fd024792c Add -lrt when linking on linux.
0921ab3db Simplify automatic detection of boost source distributions.
6b34f88a5 Make SSL/TLS version handling more consistent across OpenSSL versions.
1517bd1a1 Add travis and appveyor configuration.
70249b796 Use GetModuleHandleA rather than GetModuleHandle.
582ed12f7 Update copyright notices.
b6ac42dde Remove unused error code variable.
d52f28a09 Add missing rvalue cast in use_future implementation.
b33b3ae01 Unlocked reactor I/O implies a concurrency hint of 1.
cf351c44a Don't use non-portable sockaddr_storage member ss_len.
bbe092b3d Simplify and improve performance of executor operations.
e5acea17d Add shallow-constness to strands.
00a85845e Eliminate redundant copy as executors are now shallow-const.
git-subtree-dir: OpenVPN Adapter/Vendors/asio
git-subtree-split: 82be891ba69c65be4c684d709d78a225da69c3c5
469 lines
17 KiB
Plaintext
469 lines
17 KiB
Plaintext
[/
|
|
/ Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
|
/
|
|
/ Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
/ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
/]
|
|
|
|
[section:examples Examples]
|
|
|
|
|
|
* [link asio.examples.cpp03_examples C++03 Examples]: Illustrates the use of
|
|
Asio using only C++03 language and library features. Where necessary, the
|
|
examples make use of selected Boost C++ libraries.
|
|
|
|
* [link asio.examples.cpp11_examples C++11 Examples]: Contains a limited set of
|
|
the C++03 Asio examples, updated to use only C++11 library and language
|
|
facilities. These examples do not make direct use of Boost C++ libraries.
|
|
[/boostify: non-boost docs start here]
|
|
To show the changes between C++03 and C++11, these examples include a diff
|
|
between the C++03 and C++11 versions.
|
|
[/boostify: non-boost docs end here]
|
|
|
|
|
|
[section:cpp03_examples C++03 Examples]
|
|
|
|
|
|
[heading Allocation]
|
|
|
|
This example shows how to customise the allocation of memory associated with
|
|
asynchronous operations.
|
|
|
|
* [@../src/examples/cpp03/allocation/server.cpp]
|
|
|
|
|
|
[heading Buffers]
|
|
|
|
This example demonstrates how to create reference counted buffers that can be
|
|
used with socket read and write operations.
|
|
|
|
* [@../src/examples/cpp03/buffers/reference_counted.cpp]
|
|
|
|
|
|
[heading 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/cpp03/chat/chat_message.hpp]
|
|
* [@../src/examples/cpp03/chat/chat_client.cpp]
|
|
* [@../src/examples/cpp03/chat/chat_server.cpp]
|
|
|
|
The following POSIX-specific chat client demonstrates how to use the
|
|
[link asio.reference.posix__stream_descriptor posix::stream_descriptor] class to
|
|
perform console input and output.
|
|
|
|
* [@../src/examples/cpp03/chat/posix_chat_client.cpp]
|
|
|
|
|
|
[heading Echo]
|
|
|
|
A collection of simple clients and servers, showing the use of both synchronous
|
|
and asynchronous operations.
|
|
|
|
* [@../src/examples/cpp03/echo/async_tcp_echo_server.cpp]
|
|
* [@../src/examples/cpp03/echo/async_udp_echo_server.cpp]
|
|
* [@../src/examples/cpp03/echo/blocking_tcp_echo_client.cpp]
|
|
* [@../src/examples/cpp03/echo/blocking_tcp_echo_server.cpp]
|
|
* [@../src/examples/cpp03/echo/blocking_udp_echo_client.cpp]
|
|
* [@../src/examples/cpp03/echo/blocking_udp_echo_server.cpp]
|
|
|
|
|
|
[heading 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/cpp03/fork/daemon.cpp]
|
|
|
|
The second example demonstrates how it is possible to fork a process from
|
|
within a completion handler.
|
|
|
|
* [@../src/examples/cpp03/fork/process_per_connection.cpp]
|
|
|
|
|
|
[heading HTTP Client]
|
|
|
|
Example programs implementing simple HTTP 1.0 clients. These examples show how
|
|
to use the [link asio.reference.read_until read_until] and [link
|
|
asio.reference.async_read_until async_read_until] functions.
|
|
|
|
* [@../src/examples/cpp03/http/client/sync_client.cpp]
|
|
* [@../src/examples/cpp03/http/client/async_client.cpp]
|
|
|
|
|
|
[heading 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/cpp03/http/server/connection.cpp]
|
|
* [@../src/examples/cpp03/http/server/connection.hpp]
|
|
* [@../src/examples/cpp03/http/server/connection_manager.cpp]
|
|
* [@../src/examples/cpp03/http/server/connection_manager.hpp]
|
|
* [@../src/examples/cpp03/http/server/header.hpp]
|
|
* [@../src/examples/cpp03/http/server/main.cpp]
|
|
* [@../src/examples/cpp03/http/server/mime_types.cpp]
|
|
* [@../src/examples/cpp03/http/server/mime_types.hpp]
|
|
* [@../src/examples/cpp03/http/server/reply.cpp]
|
|
* [@../src/examples/cpp03/http/server/reply.hpp]
|
|
* [@../src/examples/cpp03/http/server/request.hpp]
|
|
* [@../src/examples/cpp03/http/server/request_handler.cpp]
|
|
* [@../src/examples/cpp03/http/server/request_handler.hpp]
|
|
* [@../src/examples/cpp03/http/server/request_parser.cpp]
|
|
* [@../src/examples/cpp03/http/server/request_parser.hpp]
|
|
* [@../src/examples/cpp03/http/server/server.cpp]
|
|
* [@../src/examples/cpp03/http/server/server.hpp]
|
|
|
|
|
|
[heading HTTP Server 2]
|
|
|
|
An HTTP server using an io_context-per-CPU design.
|
|
|
|
* [@../src/examples/cpp03/http/server2/connection.cpp]
|
|
* [@../src/examples/cpp03/http/server2/connection.hpp]
|
|
* [@../src/examples/cpp03/http/server2/header.hpp]
|
|
* [@../src/examples/cpp03/http/server2/io_context_pool.cpp]
|
|
* [@../src/examples/cpp03/http/server2/io_context_pool.hpp]
|
|
* [@../src/examples/cpp03/http/server2/main.cpp]
|
|
* [@../src/examples/cpp03/http/server2/mime_types.cpp]
|
|
* [@../src/examples/cpp03/http/server2/mime_types.hpp]
|
|
* [@../src/examples/cpp03/http/server2/reply.cpp]
|
|
* [@../src/examples/cpp03/http/server2/reply.hpp]
|
|
* [@../src/examples/cpp03/http/server2/request.hpp]
|
|
* [@../src/examples/cpp03/http/server2/request_handler.cpp]
|
|
* [@../src/examples/cpp03/http/server2/request_handler.hpp]
|
|
* [@../src/examples/cpp03/http/server2/request_parser.cpp]
|
|
* [@../src/examples/cpp03/http/server2/request_parser.hpp]
|
|
* [@../src/examples/cpp03/http/server2/server.cpp]
|
|
* [@../src/examples/cpp03/http/server2/server.hpp]
|
|
|
|
|
|
[heading HTTP Server 3]
|
|
|
|
An HTTP server using a single io_context and a thread pool calling `io_context::run()`.
|
|
|
|
* [@../src/examples/cpp03/http/server3/connection.cpp]
|
|
* [@../src/examples/cpp03/http/server3/connection.hpp]
|
|
* [@../src/examples/cpp03/http/server3/header.hpp]
|
|
* [@../src/examples/cpp03/http/server3/main.cpp]
|
|
* [@../src/examples/cpp03/http/server3/mime_types.cpp]
|
|
* [@../src/examples/cpp03/http/server3/mime_types.hpp]
|
|
* [@../src/examples/cpp03/http/server3/reply.cpp]
|
|
* [@../src/examples/cpp03/http/server3/reply.hpp]
|
|
* [@../src/examples/cpp03/http/server3/request.hpp]
|
|
* [@../src/examples/cpp03/http/server3/request_handler.cpp]
|
|
* [@../src/examples/cpp03/http/server3/request_handler.hpp]
|
|
* [@../src/examples/cpp03/http/server3/request_parser.cpp]
|
|
* [@../src/examples/cpp03/http/server3/request_parser.hpp]
|
|
* [@../src/examples/cpp03/http/server3/server.cpp]
|
|
* [@../src/examples/cpp03/http/server3/server.hpp]
|
|
|
|
|
|
[heading HTTP Server 4]
|
|
|
|
A single-threaded HTTP server implemented using stackless coroutines.
|
|
|
|
* [@../src/examples/cpp03/http/server4/file_handler.cpp]
|
|
* [@../src/examples/cpp03/http/server4/file_handler.hpp]
|
|
* [@../src/examples/cpp03/http/server4/header.hpp]
|
|
* [@../src/examples/cpp03/http/server4/main.cpp]
|
|
* [@../src/examples/cpp03/http/server4/mime_types.cpp]
|
|
* [@../src/examples/cpp03/http/server4/mime_types.hpp]
|
|
* [@../src/examples/cpp03/http/server4/reply.cpp]
|
|
* [@../src/examples/cpp03/http/server4/reply.hpp]
|
|
* [@../src/examples/cpp03/http/server4/request.hpp]
|
|
* [@../src/examples/cpp03/http/server4/request_parser.cpp]
|
|
* [@../src/examples/cpp03/http/server4/request_parser.hpp]
|
|
* [@../src/examples/cpp03/http/server4/server.cpp]
|
|
* [@../src/examples/cpp03/http/server4/server.hpp]
|
|
|
|
|
|
[heading ICMP]
|
|
|
|
This example shows how to use raw sockets with ICMP to ping a remote host.
|
|
|
|
* [@../src/examples/cpp03/icmp/ping.cpp]
|
|
* [@../src/examples/cpp03/icmp/ipv4_header.hpp]
|
|
* [@../src/examples/cpp03/icmp/icmp_header.hpp]
|
|
|
|
|
|
[heading Invocation]
|
|
|
|
This example shows how to customise handler invocation. Completion handlers are
|
|
added to a priority queue rather than executed immediately.
|
|
|
|
* [@../src/examples/cpp03/invocation/prioritised_handlers.cpp]
|
|
|
|
|
|
[heading Iostreams]
|
|
|
|
Two examples showing how to use [link asio.reference.ip__tcp.iostream
|
|
ip::tcp::iostream].
|
|
|
|
* [@../src/examples/cpp03/iostreams/daytime_client.cpp]
|
|
* [@../src/examples/cpp03/iostreams/daytime_server.cpp]
|
|
* [@../src/examples/cpp03/iostreams/http_client.cpp]
|
|
|
|
|
|
[heading Multicast]
|
|
|
|
An example showing the use of multicast to transmit packets to a group of
|
|
subscribers.
|
|
|
|
* [@../src/examples/cpp03/multicast/receiver.cpp]
|
|
* [@../src/examples/cpp03/multicast/sender.cpp]
|
|
|
|
|
|
[heading Serialization]
|
|
|
|
This example shows how Boost.Serialization can be used with asio to encode and
|
|
decode structures for transmission over a socket.
|
|
|
|
* [@../src/examples/cpp03/serialization/client.cpp]
|
|
* [@../src/examples/cpp03/serialization/connection.hpp]
|
|
* [@../src/examples/cpp03/serialization/server.cpp]
|
|
* [@../src/examples/cpp03/serialization/stock.hpp]
|
|
|
|
|
|
[heading Services]
|
|
|
|
This example demonstrates how to integrate custom functionality (in this case,
|
|
for logging) into asio's [link asio.reference.io_context io_context], and
|
|
how to use a custom service with [link
|
|
asio.reference.basic_stream_socket basic_stream_socket<>].
|
|
|
|
* [@../src/examples/cpp03/services/basic_logger.hpp]
|
|
* [@../src/examples/cpp03/services/daytime_client.cpp]
|
|
* [@../src/examples/cpp03/services/logger.hpp]
|
|
* [@../src/examples/cpp03/services/logger_service.cpp]
|
|
* [@../src/examples/cpp03/services/logger_service.hpp]
|
|
* [@../src/examples/cpp03/services/stream_socket_service.hpp]
|
|
|
|
|
|
[heading SOCKS 4]
|
|
|
|
Example client program implementing the SOCKS 4 protocol for communication via
|
|
a proxy.
|
|
|
|
* [@../src/examples/cpp03/socks4/sync_client.cpp]
|
|
* [@../src/examples/cpp03/socks4/socks4.hpp]
|
|
|
|
|
|
[heading SSL]
|
|
|
|
Example client and server programs showing the use of the [link
|
|
asio.reference.ssl__stream ssl::stream<>] template with asynchronous operations.
|
|
|
|
* [@../src/examples/cpp03/ssl/client.cpp]
|
|
* [@../src/examples/cpp03/ssl/server.cpp]
|
|
|
|
|
|
[heading Timeouts]
|
|
|
|
A collection of examples showing how to cancel long running asynchronous
|
|
operations after a period of time.
|
|
|
|
* [@../src/examples/cpp03/timeouts/async_tcp_client.cpp]
|
|
* [@../src/examples/cpp03/timeouts/blocking_tcp_client.cpp]
|
|
* [@../src/examples/cpp03/timeouts/blocking_udp_client.cpp]
|
|
* [@../src/examples/cpp03/timeouts/server.cpp]
|
|
|
|
|
|
[heading Timers]
|
|
|
|
Examples showing how to customise deadline_timer using different time types.
|
|
|
|
* [@../src/examples/cpp03/timers/tick_count_timer.cpp]
|
|
* [@../src/examples/cpp03/timers/time_t_timer.cpp]
|
|
|
|
|
|
[heading Porthopper]
|
|
|
|
Example illustrating mixed synchronous and asynchronous operations, and how to
|
|
use Boost.Lambda with Asio.
|
|
|
|
* [@../src/examples/cpp03/porthopper/protocol.hpp]
|
|
* [@../src/examples/cpp03/porthopper/client.cpp]
|
|
* [@../src/examples/cpp03/porthopper/server.cpp]
|
|
|
|
|
|
[heading Nonblocking]
|
|
|
|
Example demonstrating reactor-style operations for integrating a third-party
|
|
library that wants to perform the I/O operations itself.
|
|
|
|
* [@../src/examples/cpp03/nonblocking/third_party_lib.cpp]
|
|
|
|
|
|
[heading Spawn]
|
|
|
|
Example of using the asio::spawn() function, a wrapper around the
|
|
[@http://www.boost.org/doc/libs/release/libs/coroutine/index.html Boost.Coroutine]
|
|
library, to implement a chain of asynchronous operations using stackful
|
|
coroutines.
|
|
|
|
* [@../src/examples/cpp03/spawn/echo_server.cpp]
|
|
|
|
|
|
[heading UNIX Domain Sockets]
|
|
|
|
Examples showing how to use UNIX domain (local) sockets.
|
|
|
|
* [@../src/examples/cpp03/local/connect_pair.cpp]
|
|
* [@../src/examples/cpp03/local/iostream_client.cpp]
|
|
* [@../src/examples/cpp03/local/stream_server.cpp]
|
|
* [@../src/examples/cpp03/local/stream_client.cpp]
|
|
|
|
|
|
[heading Windows]
|
|
|
|
An example showing how to use the Windows-specific function `TransmitFile`
|
|
with Asio.
|
|
|
|
* [@../src/examples/cpp03/windows/transmit_file.cpp]
|
|
|
|
|
|
[endsect]
|
|
|
|
|
|
[section:cpp11_examples C++11 Examples]
|
|
|
|
|
|
[heading Allocation]
|
|
|
|
This example shows how to customise the allocation of memory associated with
|
|
asynchronous operations.
|
|
|
|
* [@../src/examples/cpp11/allocation/server.cpp] ([@examples/diffs/allocation/server.cpp.html diff to C++03])
|
|
|
|
|
|
[heading 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] ([@examples/diffs/buffers/reference_counted.cpp.html diff to C++03])
|
|
|
|
|
|
[heading 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] ([@examples/diffs/chat/chat_message.hpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/chat/chat_client.cpp] ([@examples/diffs/chat/chat_client.cpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/chat/chat_server.cpp] ([@examples/diffs/chat/chat_server.cpp.html diff to C++03])
|
|
|
|
|
|
[heading 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] ([@examples/diffs/echo/async_tcp_echo_server.cpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/echo/async_udp_echo_server.cpp] ([@examples/diffs/echo/async_udp_echo_server.cpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/echo/blocking_tcp_echo_client.cpp] ([@examples/diffs/echo/blocking_tcp_echo_client.cpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/echo/blocking_tcp_echo_server.cpp] ([@examples/diffs/echo/blocking_tcp_echo_server.cpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/echo/blocking_udp_echo_client.cpp] ([@examples/diffs/echo/blocking_udp_echo_client.cpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/echo/blocking_udp_echo_server.cpp] ([@examples/diffs/echo/blocking_udp_echo_server.cpp.html diff to C++03])
|
|
|
|
|
|
[heading 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] ([@examples/diffs/fork/daemon.cpp.html 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] ([@examples/diffs/fork/process_per_connection.cpp.html diff to C++03])
|
|
|
|
|
|
[heading Futures]
|
|
|
|
This example demonstrates how to use std::future in conjunction with
|
|
Asio's asynchronous operations.
|
|
|
|
* [@../src/examples/cpp11/futures/daytime_client.cpp]
|
|
|
|
|
|
[heading Handler Tracking]
|
|
|
|
This example shows how to implement custom handler tracking.
|
|
|
|
* [@../src/examples/cpp11/handler_tracking/custom_tracking.hpp]
|
|
|
|
|
|
[heading 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] ([@examples/diffs/http/server/connection.cpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/http/server/connection.hpp] ([@examples/diffs/http/server/connection.hpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/http/server/connection_manager.cpp] ([@examples/diffs/http/server/connection_manager.cpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/http/server/connection_manager.hpp] ([@examples/diffs/http/server/connection_manager.hpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/http/server/header.hpp] ([@examples/diffs/http/server/header.hpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/http/server/main.cpp] ([@examples/diffs/http/server/main.cpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/http/server/mime_types.cpp] ([@examples/diffs/http/server/mime_types.cpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/http/server/mime_types.hpp] ([@examples/diffs/http/server/mime_types.hpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/http/server/reply.cpp] ([@examples/diffs/http/server/reply.cpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/http/server/reply.hpp] ([@examples/diffs/http/server/reply.hpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/http/server/request.hpp] ([@examples/diffs/http/server/request.hpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/http/server/request_handler.cpp] ([@examples/diffs/http/server/request_handler.cpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/http/server/request_handler.hpp] ([@examples/diffs/http/server/request_handler.hpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/http/server/request_parser.cpp] ([@examples/diffs/http/server/request_parser.cpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/http/server/request_parser.hpp] ([@examples/diffs/http/server/request_parser.hpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/http/server/server.cpp] ([@examples/diffs/http/server/server.cpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/http/server/server.hpp] ([@examples/diffs/http/server/server.hpp.html diff to C++03])
|
|
|
|
|
|
[heading Multicast]
|
|
|
|
An example showing the use of multicast to transmit packets to a group of
|
|
subscribers.
|
|
|
|
* [@../src/examples/cpp11/multicast/receiver.cpp] ([@examples/diffs/multicast/receiver.cpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/multicast/sender.cpp] ([@examples/diffs/multicast/sender.cpp.html diff to C++03])
|
|
|
|
|
|
[heading 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] ([@examples/diffs/nonblocking/third_party_lib.cpp.html diff to C++03])
|
|
|
|
|
|
[heading Spawn]
|
|
|
|
Example of using the asio::spawn() function, a wrapper around the
|
|
[@http://www.boost.org/doc/libs/release/libs/coroutine/index.html Boost.Coroutine]
|
|
library, to implement a chain of asynchronous operations using stackful
|
|
coroutines.
|
|
|
|
* [@../src/examples/cpp11/spawn/echo_server.cpp] ([@examples/diffs/spawn/echo_server.cpp.html diff to C++03])
|
|
|
|
|
|
[heading UNIX Domain Sockets]
|
|
|
|
Examples showing how to use UNIX domain (local) sockets.
|
|
|
|
* [@../src/examples/cpp11/local/connect_pair.cpp] ([@examples/diffs/local/connect_pair.cpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/local/iostream_client.cpp] ([@examples/diffs/local/iostream_client.cpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/local/stream_server.cpp] ([@examples/diffs/local/stream_server.cpp.html diff to C++03])
|
|
* [@../src/examples/cpp11/local/stream_client.cpp] ([@examples/diffs/local/stream_client.cpp.html diff to C++03])
|
|
|
|
|
|
[endsect]
|
|
|
|
|
|
[endsect]
|