std::futureavailability with libstdc++.
std::string_viewwith newer clang/libc++.
empty()on default-constructed resolver results.
std::string_viewdetection issue when using clang-cl.
experimental::co_spawnfacility for integration with the coroutines technical specification.
asio::io_context::run_for()function for blocking clients.
(BOOST_)ASIO_USE_BOOST_DATE_TIME_FOR_SOCKET_IOSTREAMto enable the old Boost.Date_Time interface in
async_resultincompatibility with deprecated
add_certificate_authorityto process multiple certificates in a bundle.
std::string_viewfor C++17 or later, and
std::experimental::string_viewfor C++14. Define the preprocessor macro
(BOOST_)ASIO_DISABLE_STD_STRING_VIEWto force the use of std::experimental::string_view (assuming it is available) when compiling in C++17 mode.
DynamicBuffertemplate arguments are decayed before using in
basic_yield_contextto work with completion signatures containing reference parameters.
spawn()correctly store decayed copies of their function and handler arguments.
basic_socket<Protocol, SocketService>we now have simply
basic_socket<Protocol>. The old interface can be enabled by defining the
Executortype requirements and classes to support an executor framework, including the
execution_contextbase class, the
executor_workclass for tracking outstanding work, and the
executorpolymorphic wrapper. Free functions
defer()have been added and are used to submit function objects to executors.
wrap()is used to associate an executor with a handler or other object. The handler hooks for allocation, invocation and continuation have been deprecated.
system_executorclass has been added as a default executor.
io_serviceclass is now derived from
execution_contextand implements the executor type requirements in its nested
executor_typeclass. The member functions
wrap()have been deprecated. The
io_service::workclass has been deprecated.
reset()has been renamed to
restart(). The old name is retained for backward compatibility but has been deprecated.
make_service<>()function is now used to add a new service to an execution context such as an
add_service()function has been deprecated.
strand<>template has been added to allow strand functionality to be used with generic executor types.
context()member function. The
get_io_service()member function is deprecated.
io_service::strand::dispatch()functions still require copyable handlers.
expiry()member function for obtaining the expiry time. The accessors
expires_after()have been deprecated, though those names are retained for the mutating members.
std::packaged_taskclass template is now supported as a completion handler. The initiating operation automatically returns the future associated with the task. The
package()function has been added as a convenient factory for packaged tasks.
async_wait()operations that may be used to wait for readiness. The
null_bufferstype has been deprecated.
make_address_v6()free functions. The
v4_mapped()member functions have been deprecated.
ip::addressnow represents an invalid address value that is neither IPv4 nor IPv6.
buffer()overloads that generate mutable buffers for non-const
asio::streambufclass. This support includes:
dynamic_vector_bufferadapter classes that meet the
dynamic_buffer()factory functions for creating a dynamic buffer adapter for a
async_read_until()free functions that directly support dynamic buffer sequences.
address_iterator_v4for iterating across IPv4 addresses
address_iterator_v6for iterating across IPv6 addresses
address_range_v4to represent a range of IPv4 addresses
address_range_v6to represent a range of IPv6 addresses
network_v4for manipulating IPv4 CIDR addresses, e.g. 22.214.171.124/24
network_v6for manipulating IPv6 CIDR addresses, e.g. ffe0:/120
<asio/ts/*.hpp>that correspond to the headers in the proposal.
spawn()to be executor-aware.
spawn()overload that takes only a function object.
yield_contextto permit nested calls to the completion handler.
std::endlto ensure output is flushed.
ssl::stream<>bug that may result in spurious 'short read' errors.
yield_contextobject with asynchronous operations.
ConnectExfunction are mapped to their portable equivalents.
join_groupfailures as non-fatal.
kqueuereactor so that it works on FreeBSD.
kqueuereactor which resulted in spinning when using serial ports on Mac OS.
kqueuereactor support for read-only file descriptors.
WSASocketAhas been deprecated.
spawn()are not made available when including the
asio::strandas deprecated. Use
kqueuebackend that was introduced in Asio 1.10.2.
gccproblem to do with anonymous enums.
HANDLEbackend change to ignore
ERROR_MORE_DATA. Instead, the error will be propagated as with any other (i.e. in an
error_codeor thrown as a
system_error), and the number of bytes transferred will be returned. For code that needs to handle partial messages, the
error_codeoverload should be used.
signal_setimplementation's signal number check.
GetVersionExhas been deprecated.
asio::spawn()to work correctly with new Boost.Coroutine interface.
asio::spawn()coroutines are correctly unwound when cleaned up by the
ConnectEx, if available, for connection-oriented IP sockets.
io_servicebackend for non-Windows (and non-IOCP Windows) platforms to use a single condition variable per
io_serviceinstance. This addresses a potential race condition when
run_one()is used from multiple threads.
EV_CLEARhandling in the kqueue backend, to address other cases where the
close()system call may hang on Mac OS X.
selectreactor more efficient on Windows for large numbers of sockets.
GetQueuedCompletionStatustimeout workaround on recent versions of Windows.
FormatMessageA, as the Windows store does not permit the latter.
strand, buffers, composed operations, timers, etc., should all work as normal.
cancel()function is not supported for sockets. Asynchronous operations may only be cancelled by closing the socket.
null_buffersare not supported.
socket_base::keep_aliveoptions are supported.
ASIO_STANDALONEon your compiler command line or as part of the project options. This standalone configuration has been tested for the following platforms and compilers:
async_connectwere not correctly propagated through to the completion handler.
io_service. When the bug occurs, the result of an asynchronous operation (error and bytes tranferred) is incorrectly discarded and zero values used instead. For TCP sockets this results in spurious end-of-file notifications.
async_waiton a signal that is already raised.
HANDLEbackend to treat
ERROR_MORE_DATAas a non-fatal error when returned by
GetOverlappedResultfor a synchronous read.
genericas a keyword. Added a workaround that renames the namespace to
cpp_genericwhen those language extensions are in effect.
async_resultsupport in 1.10.0. In particular, the buffered stream templates have been updated so that they adhere to current handler patterns.
use_futuresupport for Microsoft Visual Studio 2012.
std::minin the Windows IOCP backend to avoid a dependency on the
async_result, that allow the customisation of the return type of an initiating function.
asio::spawn()function, a high-level wrapper for running stackful coroutines, based on the Boost.Coroutine library. The
spawn()function enables programs to implement asynchronous logic in a synchronous manner. For example:
size_t n = my_socket.async_read_some(my_buffer, yield);. For further information, see Stackful Coroutines.
asio::use_futurespecial value, which provides first-class support for returning a C++11
std::futurefrom an asynchronous operation's initiating function. For example:
future<size_t> = my_socket.async_read_some(my_buffer, asio::use_future);. For further information, see C++ 2011 Support - Futures.
asio_handler_is_continuation. Asynchronous operations may represent a continuation of the asynchronous control flow associated with the current executing handler. The
asio_handler_is_continuationhook can be customised to return
trueif this is the case, and Asio's implementation can use this knowledge to optimise scheduling of the new handler. To cover common cases, Asio customises the hook for strands,
spawn()and composed asynchronous operations.
generic::stream_protocol, which implement the
Protocoltype requirements, but allow the user to specify the address family (e.g.
AF_INET) and protocol type (e.g.
IPPROTO_TCP) at runtime. For further information, see Support for Other Protocols.
ip::tcp::socketcan be converted into a
generic::stream_protocol::socketvia move construction. For further information, see Support for Other Protocols.
async_accept()functions to allow a new connection to be accepted directly into a socket of a more generic type. For example, an
ip::tcp::acceptorcan be used to accept into a
generic::stream_protocol::socketobject. For further information, see Support for Other Protocols.
ASIO_STANDALONEon your compiler command line or as part of the project options. This standalone configuration has currently been tested for the following platforms and compilers:
async_handshake()functions have been added. These accept a
ConstBufferSequenceto be used as initial input to the ssl engine for the handshake procedure.
set_verify_depth()function to the
use_tmp_dh(), have been added to the
ssl::contextto automatically disable SSL compression by default. To enable, use the new
ssl::context::clear_options()function, as in
error_codewith an invalid (i.e.
basic_waitable_timer's underlying implementation so that it can handle any
time_pointvalue without overflowing the intermediate duration objects.
poll()on the same
intfor SSL_CTX options, to match OpenSSL.
_snwprintfto address a compile error due to the changed
swprintfsignature in recent versions of MinGW.
io_servicethreads due to running out of work.
#include <cctype>, needed for some versions of MinGW.
gcc's atomic builtins on ARM CPUs, when available.
io_servicehas been destroyed.
epoll_create1()function but always fail with ENOSYS.
epoll_reactorbackend to do lazy registration for
epoll_reactorhandling of out-of-band data, which was broken by an incomplete fix in the last release.
windows::object_handleso that it works with Windows compilers that support C++11 move semantics (such as
g++4.7 when compiling in C++11 mode.
signal_sethandlers were not being delivered when the
io_servicewas constructed with a
basic_waitable_timerbased around the C++11 clock type requirements. It may be used with the clocks from the C++11
<chrono>library facility or, if those are not available, Boost.Chrono. The typedefs
system_timermay be used to create timer objects for the standard clock types.
windows::object_handleclass for performing waits on Windows kernel objects. Thanks go to Boris Schaeling for contributing substantially to the development of this feature.
connect()can return EAGAIN in certain circumstances. Remapped this to another error so that it doesn't look like a non-blocking operation.
io_serviceis repeatedly run without anything to do.
concurrency_hintis 1) to eliminate a lock/unlock pair.
epoll_reactorspeculative operations to be performed without holding the lock.
epoll_reactor's I/O operation immediately before the corresponding handler is called. This also improves scalability across CPUs when multiple threads are running the
std::array) of exactly two buffers.
signal()function from the global namespace.
deadline_timerimplementation so that it does not read the clock unless the timer heap is non-empty.
null_buffersoperations so that they obey the user's non-blocking setting.
fd_setat runtime when using Windows.
(BOOST_)ASIO_STRAND_IMPLEMENTATIONSto the desired number.
(BOOST_)ASIO_ENABLE_SEQUENTIAL_STRAND_ALLOCATIONflag which switches the allocation of strand implementations to use a round-robin approach rather than hashing.
-std=c++0xmode on g++ 4.5 or higher.
errnois preserved across the implementation's signal handler.
tick_count_timerexample by making the duration type signed. Previously, a wait on an already-passed deadline would not return for a very long time.
std::array, when available. The support is automatically enabled when compiling in
-std=c++0xmode on g++ 4.3 or higher, or when using MSVC 10. The support may be explicitly enabled by defining
(BOOST_)ASIO_HAS_STD_ARRAY, or disabled by defining
atomicwhen they are available, rather than the Boost equivalents.
std::system_erroris no longer enabled by default for g++ 4.5, as that compiler's standard library does not implement
fork()system call. Programs that use
io_service.notify_fork()at the appropriate times. Two new examples have been added showing how to use this feature.
close()system call. In particular, assume that most operating systems won't have
EWOULDBLOCK, but if it does then set the blocking mode and restart the call. If any other error occurs, assume the descriptor is closed.
EV_ONESHOTseems to cause problems on some versions of Mac OS X, with the
io_servicedestructor getting stuck inside the
close()system call. Changed the kqueue backend to use
shutdown_service()member functions to be private.
signal_set_service.hppso that constants like
NSIGmay be used.
signal_set_serviceimplementation so that it doesn't assume that
SIGRTMAXis a compile-time constant.
signal_set. Programs may add one or more signals to the set, and then perform an
async_wait()operation. The specified handler will be called when one of the signals occurs. The same signal number may registered with multiple
signal_setobjects, however the signal number must be used only with Asio.
(BOOST_)ASIO_ENABLE_HANDLER_TRACKING, Asio writes debugging output to the standard error stream. The output records asynchronous operations and the relationships between their handlers. It may be post-processed using the included
handlerviz.pltool to create a visual representation of the handlers (requires GraphViz).
consume()function did not always update the internal buffer pointers correctly. The problem may occur when the
asio::streambufis filled with data using the standard C++ member functions such as
sputn(). (Note: the problem does not manifest when the streambuf is populated by the Asio free functions
perform()function are not correctly re-registered with kqueue.
std::system_erroris no longer enabled by default for MSVC10, as that compiler's standard library does not implement
ip::basic_resolver_iteratorclasses so that the value_type typedefs are non-const byte types.
ip::tcp::iostream. A timeout is set by calling
expires_from_now()to establish a deadline. Any socket operations which occur past the deadline will put the iostream into a bad state.
error()member function to socket iostreams, for retrieving the error code from the most recent system call.
basic_deadline_timer::cancel_one()function. This function lets you cancel a single waiting handler on a timer. Handlers are cancelled in FIFO order.
transfer_exactly()completion condition. This can be used to send or receive a specified number of bytes even if the total size of the buffer (or buffer sequence) is larger.
async_connect(). These operations try each endpoint in a list until the socket is successfully connected.
buffer_size()function so that it works for buffer sequences in addition to individual buffers.
buffer_copy()function that can be used to copy the raw bytes between individual buffers and buffer sequences.
write_at()that do not require a completion condition.
static_assertis also used to generate an informative error message. This checking may be disabled by defining
std::system_error, when available. The support is automatically enabled when compiling in
-std=c++0xmode on g++ 4.5 or higher, or when using MSVC 10. The support may be explicitly enabled by defining
ASIO_HAS_STD_SYSTEM_ERROR, or disabled by defining
ASIO_DISABLE_STD_SYSTEM_ERROR. (Available in non-Boost version of Asio only.)
is_multicast()functions consistently available across the
non_blocking()functions for managing the non-blocking behaviour of a socket or descriptor. The
non_blocking_ioare now deprecated in favour of these new functions.
native_non_blocking()functions for managing the non-blocking mode of the underlying socket or descriptor. These functions are intended to allow the encapsulation of arbitrary non-blocking system calls as asynchronous operations, in a way that is transparent to the user of the socket object. The functions have no effect on the behaviour of the synchronous operations of the socket or descriptor.
io_control()member function for socket acceptors.
native_typetypedefs in favour of
native_handle_type, and the
native()member functions in favour of
release()member function to posix descriptors. This function releases ownership of the underlying native descriptor to the caller.
io_service::stopped()function that can be used to determine whether the
io_servicehas stopped (i.e. a
reset()call is needed prior to any further calls to
-std=c++0xmode on g++ 4.5 or higher, or when using MSVC10.
ip::basic_endpoint<>objects (such as
assign()may have been
dup()-ed, and so require explicit deregistration from the reactor.
get_io_service()member functions should be used instead.
FIONBIOconstant to int to suppress a compiler warning on some platforms.
ip::address_v4::broadcast()is used on 64-bit platforms.
timerfdsupport) that prevents timely delivery of
deadline_timerhandlers, after the program has been running for some time.
deadline_timermay never fire if the
io_serviceis running in a background thread.
closesocket()failures are correctly propagated.
pselect()on HP-UX, if it is available.
deadline_timerobjects with expiry times set more than 5 minutes in the future may never expire.
0, as per the documentation.
idto avoid clashing with Objective-C++ keywords.
vectorreallocation performance issue that can occur when there are many active
io_control()implementation on 64-bit Mac OS X and BSD platforms.
accept()are incorrectly treated as successes.
asio/impl/src.cppin favour of
#includes, e.g. if the program uses boost::array but does not explicitly include
deadline_timerimplementation to improve performance.
async_read_until(). These read operations now use the existing capacity of the
streambufwhen reading, rather than limiting the read to 512 bytes.
asio/impl/src.cppin one source file in a program, then build the program with
(BOOST_)ASIO_SEPARATE_COMPILATIONdefined in the project/compiler settings. Alternatively,
(BOOST_)ASIO_DYN_LINKmay be defined to build a separately-compiled Asio as part of a shared library.
(BOOST_)ASIO_DISABLE_FENCED_BLOCKto permit the disabling of memory fences around completion handlers, even if thread support is enabled.
null_buffersoperations on Windows.
timerfdfor dispatching timers on Linux, when available.
ip::resolver_query_base::flagsas per the TR2 proposal. This type prevents implicit conversion from
flags, allowing the compiler to catch cases where users incorrectly pass a numeric port number as the service name.
#define NOMINMAXfor all Windows compilers. Users can define
(BOOST_)ASIO_NO_NOMINMAXto suppress this definition.
error::eofresult to the completion handler.
io_control()member functions to always call
ioctlon the underlying descriptor when modifying blocking mode.
InternetProtocol::resolver_iterator, as neither typedef is part of the documented
InternetProtocolrequirements. The corresponding typedefs in the
ip::icmpclasses have been deprecated.
(BOOST_)ASIO_DISABLE_THREADSmacro that allows Asio's threading support to be independently disabled.
boost::addressofto get the address of handler objects, rather than applying
OVERLAPPEDstructure to be valid until both the initiating function call has returned and the completion packet has been delivered.
boost_prefix to the
extern "C"thread entry point function.
getaddrinfoemulation, only check the socket type (
SOCK_DGRAM) if a service name has been specified. This should allow the emulation to work with raw sockets.
buffered*_stream<>templates to treat 0-byte reads and writes as no-ops, to comply with the documented type requirements for
boost::throw_exception()to allow Asio to be used when exception support is disabled. Note that the SSL wrappers still require exception support.
(BOOST_)ASIO_HASH_MAP_BUCKETSmay be used to tweak the sizes used for the bucket arrays. (N.B. this feature introduced a bug which was fixed in Asio 1.4.3 / Boost 1.40.)
io_control()so that it adheres to the documented type requirements for IoControlCommand.
ReadFilecall fails with
ERROR_MORE_DATA. This enables a hack where a
windows::stream_handlecan be used with a message-oriented named pipe.
windows::overlapped_ptr::complete()are correctly passed to the completion handler.
size_t CompletionCondition(error_code ec, size_t total), where the return value indicates the maximum number of bytes to be transferred on the next read or write operation. (The old CompletionCondition signature is still supported for backwards compatibility).
windows::overlapped_ptrclass to allow arbitrary overlapped I/O functions (such as
TransmitFile) to be used with Asio.
eventfddescriptor is now used (rather than a pipe) to interrupt a blocked select/epoll reactor.
io_serviceimplementations now use lazy initialisation to reduce the memory usage of an
io_serviceobject used only as a message queue.
HANDLEs such as named pipes (requires
HANDLEs that work with I/O completion ports).
HANDLEs such as files (requires
HANDLEs that work with I/O completion ports).
async_read_until()overloads that take a user-defined function object for locating message boundaries.
(BOOST_)ASIO_ENABLE_TWO_LOCK_QUEUE) that may provide better
io_servicescalability across many processors.
First stable release of Asio.