Asynchronous operations may represent a continuation of the asynchronous
control flow associated with the current handler. Asio's implementation
can use this knowledge to optimise scheduling of the handler.
The asio_handler_is_continuation hook returns true to indicate whether a
completion handler represents a continuation of the current call
context. The default implementation of the hook returns false, and
applications may customise the hook when necessary. The hook has already
been customised within Asio to return true for the following cases:
- Handlers returned by strand.wrap(), when the corresponding
asynchronous operation is being initiated from within the strand.
- The internal handlers used to implement the asio::spawn() function's
stackful coroutines.
- When an intermediate handler of a composed operation (e.g.
asio::async_read(), asio::async_write(), asio::async_connect(),
ssl::stream<>, etc.) starts a new asynchronous operation due to the
composed operation not being complete.
To support this optimisation, a new running_in_this_thread() member
function has been added to the io_service::strand class. This function
returns true when called from within a strand.
[SVN r84314]
io_service.notify_fork() at the appropriate times. Two new examples have been
added showing how to use this feature. Refs #3238, #4162.
* Clean up the handling of errors reported by the close() system call. In
particular, assume that most operating systems won't have close() fail with
EWOULDBLOCK, but if it does then set blocking mode and restart the call. If
any other error occurs we assume the descriptor is closed. Refs #3307.
* EV_ONESHOT seems to cause problems on some versions of Mac OS X, with the
io_service destructor getting stuck inside the close() system call. Use
EV_CLEAR instead. Refs #5021.
* Include function name in exception what() messages.
* Fix insufficient initialisers warning with MinGW.
* Make the shutdown_service() member functions private.
* Add archetypes for testing socket option functions.
* Add missing lock in signal_set_service::cancel().
* Fix copy/paste error in SignalHandler example.
* The signal header needs to be included in signal_set_service.hpp so that we
can use constants like NSIG and SIGRTMAX.
* Don't use Boost.Thread's convenience header. Use the header file that is
specifically for the boost::thread class instead.
[SVN r69467]
Make basic_io_object constructor protected.
Make a 0-length send or receive on a stream socket into a no-op.
Add cancel() function for cancelling asynchronous socket operations.
The Win32 implementation only works if all operations for the socket
have been issued from the same thread, otherwise it fails with
asio::error::not_supported.
Add workaround for an apparent Windows bug where using getpeername on
a socket accepted using AcceptEx will sometimes return an endpoint
that is all zeroes.
Make a strand last as long as it has any handlers to dispatch. Make
strand a nested class of io_service.
Add io_service() function to io_service::work to return a reference to
the io_service object on which the work is being performed. Renamed
io_service::service::owner() to io_service::service::io_service().
Unset linger object when socket objects are destroyed.
Rename asio_handler_dispatch to asio_handler_invoke.
Rename basic_socketbuf to basic_socket_streambuf.
Update ip::address_v4 and ip::address_v6 classes to match TR2
proposal.
Add run_one(), poll() and poll_one() functions to the io_service.
Remove need to #define FD_SETSIZE on Win32.
Add detection of incorrect inclusion of WinSock.h.
Fix some SSL bugs. Add ability to customise the SSL password callback
function.
Set the reuse_address option by default on acceptors.
The macros FIONREAD and FIONBIO are not integer constants on all
platforms, and so cannot be used as template arguments. Make the
corresponding I/O control commands into proper classes, not templates.
Fixes to better support *BSD platforms.
Add support for buffer debugging, if the standard library supports
iterator debugging (as MSVC8's standard lib does).
Ensure the IOCP queue is drained correctly at shutdown.
Move basic_resolver and resolver service into the ip namespace.
Fix some issues found by the inspect tool.
[SVN r35833]