Boost.Asio
Boost.Asio is a cross-platform C++ library for network programming that
provides developers with a consistent asynchronous I/O model using a
modern C++ approach.
Getting Started
The tutorial introduces the fundamental
concepts required to use Boost.Asio, and shows how to use Boost.Asio to
develop simple client and server programs.
The examples illustrate the use of
Boost.Asio in more complex applications.
Dependencies
There is no need to build any of the Boost libraries to use most of
Boost.Asio, and only the header files are required. However, some
overloads of read_until and async_read_until require
the Boost.Regex library. (Note: with MSVC or Borland C++ you may need to
add -DBOOST_ALL_NO_LIB to your project settings to disable autolinking of
the Boost.Date_Time and Boost.Regex libraries.)
To use the SSL support, OpenSSL is
required. OpenSSL is not necessary to use the rest of Boost.Asio.
Supported Platforms
The following platforms and compilers have been tested:
-
Win32 using Visual C++ 7.1 and Visual C++ 8.0.
-
Win32 using Borland C++Builder 6 patch 4.
-
Win32 using MinGW.
-
Win32 using Cygwin. (__USE_W32_SOCKETS must be defined.)
-
Linux (2.4 or 2.6 kernels) using g++ 3.3 or later.
-
Solaris using g++ 3.3 or later.
-
Mac OS X 10.4 using g++ 3.3 or later.
-
QNX Neutrino 6.3 using g++ 3.3 or later.
Rationale
The Boost.Asio library is intended for programmers using C++ for systems
programming, where access to operating system functionality such as
networking is often required. In particular, Boost.Asio attempts to
address the following goals:
-
Portability. The library should support, and provide consistent
behaviour across, a range of commonly used operating systems.
-
Scalability. The library should allow, and indeed encourage,
the development of network applications that scale to hundreds or
thousands of concurrent connections. The library implementation for
each operating system should use the mechanism that best enables this
scalability.
-
Efficiency. The library should support techniques such as
scatter-gather I/O, and allow protocol implementations that minimise
data copying.
-
Model Berkeley sockets. The Berkeley sockets API is widely
implemented and understood, as well as being covered in much
literature. Other programming languages often use a similar interface
for networking APIs.
-
Ease of use. Lower the entry barrier for new users by taking a
toolkit, rather than framework, approach. That is, try to minimise
the up-front investment in time to just learning a few basic rules and
guidelines. After that, a library user should only need to understand
the specific functions that are being used.
-
Basis for further abstraction. The library should permit the
development of other libraries that provide higher levels of
abstraction. For example, implementations of commonly used protocols
such as HTTP.
Although the current incarnation of Boost.Asio focuses primarily on
networking, its concepts of asynchronous I/O can be extended to include
other operating system resources such as files.
|
Copyright © 2003 - 2006 Christopher M. Kohlhoff |