...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
The following platforms and compilers have been tested:
__USE_W32_SOCKETS
must be defined.)
The following platforms may also work:
The following libraries must be available in order to link programs that use Boost.Asio:
boost::system::error_code
and boost::system::system_error
classes.
read_until()
or async_read_until()
overloads that take a boost::regex
parameter.
Furthermore, some of the examples also require the Boost.Thread, Boost.Date_Time or Boost.Serialization libraries.
Note | |
---|---|
With MSVC or Borland C++ you may want to add |
You may build the subset of Boost libraries required to use Boost.Asio and its examples by running the following command from the root of the Boost download package:
bjam --with-system --with-thread --with-date_time --with-regex --with-serialization stage
This assumes that you have already built bjam
.
Consult the Boost.Build documentation for more details.
The macros listed in the table below may be used to control the behaviour of Boost.Asio.
Macro |
Description |
---|---|
|
Enables Boost.Asio's buffer debugging support, which can help identify when invalid buffers are used in read or write operations (e.g. if a std::string object being written is destroyed before the write operation completes).
When using Microsoft Visual C++, this macro is defined automatically
if the compiler's iterator debugging support is enabled, unless
When using g++, this macro is defined automatically if standard library
debugging is enabled ( |
|
Explictly disables Boost.Asio's buffer debugging support. |
|
Explicitly disables |
|
Explicitly disables |
|
Explicitly disables |
|
Explicitly disables |
|
Explicitly disables I/O completion ports support on Windows, forcing
the use of a |
|
By default, Boost.Asio will automatically define |
|
When compiling for Windows using Microsoft Visual C++ or Borland C++,
Boost.Asio will automatically link in the necessary Windows SDK libraries
for sockets support (i.e. |
|
Determines the maximum number of arguments that may be passed to the
|
|
Determines the maximum number of arguments that may be passed to the
|
|
Enables use of the
The * It will only cancel asynchronous operations that were initiated in the current thread. * It can appear to complete without error, but the request to cancel the unfinished operations may be silently ignored by the operating system. Whether it works or not seems to depend on the drivers that are installed. For portable cancellation, consider using one of the following alternatives: * Disable asio's I/O completion port backend by defining BOOST_ASIO_DISABLE_IOCP. * Use the socket object's close() function to simultaneously cancel the outstanding operations and close the socket. |
|
Disables uses of the |
|
Determines the number of buckets in Boost.Asio's internal Some examples:
* Defining
* Defining |
A mailing list specifically for Boost.Asio may be found on SourceForge.net. Newsgroup access is provided via Gmane.
Users are encouraged to share examples, tips and FAQs on the Boost.Asio wiki, which is located at http://asio.sourceforge.net.