2
0
mirror of https://github.com/boostorg/asio.git synced 2026-01-27 18:42:07 +00:00
Files
asio/doc/using.qbk
Christopher Kohlhoff 8e413b0ece Merge from trunk.
........
  r48414 | chris_kohlhoff | 2008-08-28 22:03:46 +1000 (Thu, 28 Aug 2008) | 2 lines
  
  Fix uninitialised event handles in asio::detail::thread in external mode.
........
  r48415 | chris_kohlhoff | 2008-08-28 22:04:21 +1000 (Thu, 28 Aug 2008) | 2 lines
  
  Fix duplicate variable warning.
........
  r48416 | chris_kohlhoff | 2008-08-28 22:06:42 +1000 (Thu, 28 Aug 2008) | 3 lines
  
  Fix duplicate variable warning. Use get_io_service() rather than
  deprecated io_service() function.
........
  r48417 | chris_kohlhoff | 2008-08-28 22:09:09 +1000 (Thu, 28 Aug 2008) | 2 lines
  
  Use get_io_service() rather than deprecated io_service() function.
........
  r48418 | chris_kohlhoff | 2008-08-28 22:11:47 +1000 (Thu, 28 Aug 2008) | 9 lines
  
  Change the CompletionCondition concept so that:
  - It is now evaluated before the first call to the underlying
    *_some() operation, as well as after every operation.
  - The return value is a number of bytes, which indicates the maximum
    length to be transferred on the subsequent *_some() operation. If
    the return value is 0 then the composed operation completes.
  
  Add missing unit tests for read_at and write_at.
........
  r48490 | chris_kohlhoff | 2008-08-31 18:58:49 +1000 (Sun, 31 Aug 2008) | 2 lines
  
  Don't build serial port test code when serial ports are not available.
........
  r48491 | chris_kohlhoff | 2008-08-31 19:01:59 +1000 (Sun, 31 Aug 2008) | 3 lines
  
  Refactor reactive socket implementation so that synchronous read, write,
  accept and connect operations don't modify data associated with the socket.
........
  r48495 | chris_kohlhoff | 2008-08-31 21:38:52 +1000 (Sun, 31 Aug 2008) | 2 lines
  
  Add class to allow use of arbitrary Windows overlapped I/O operations.
........
  r48524 | chris_kohlhoff | 2008-09-02 09:04:35 +1000 (Tue, 02 Sep 2008) | 3 lines
  
  Add support for using an eventfd descriptor on linux to interrupt a blocked
  epoll/select reactor.
........
  r48525 | chris_kohlhoff | 2008-09-02 09:05:05 +1000 (Tue, 02 Sep 2008) | 3 lines
  
  Use templates to handle iovec structures that have an iov_base member of
  type char*.
........
  r48526 | chris_kohlhoff | 2008-09-02 09:07:29 +1000 (Tue, 02 Sep 2008) | 2 lines
  
  Fix error in comment.
........
  r48527 | chris_kohlhoff | 2008-09-02 18:46:46 +1000 (Tue, 02 Sep 2008) | 2 lines
  
  Fix to compile with MSVC 7.1.
........
  r48535 | chris_kohlhoff | 2008-09-02 21:34:18 +1000 (Tue, 02 Sep 2008) | 2 lines
  
  Add const overloads of the lowest_layer member functions.
........
  r48558 | chris_kohlhoff | 2008-09-03 18:56:43 +1000 (Wed, 03 Sep 2008) | 2 lines
  
  Oops, changeset 48535 accidentally reverted 48527's fix.
........
  r48559 | chris_kohlhoff | 2008-09-03 18:57:48 +1000 (Wed, 03 Sep 2008) | 2 lines
  
  Add a workaround for a possible gcc 4.3 optimiser bug.
........
  r48560 | chris_kohlhoff | 2008-09-03 19:06:10 +1000 (Wed, 03 Sep 2008) | 2 lines
  
  Explicitly specify return type with bind to keep some compilers happy.
........
  r48561 | chris_kohlhoff | 2008-09-03 19:08:04 +1000 (Wed, 03 Sep 2008) | 2 lines
  
  Update completion_condition documentation to match new signature.
........
  r48562 | chris_kohlhoff | 2008-09-03 21:36:43 +1000 (Wed, 03 Sep 2008) | 2 lines
  
  Add windows/transmit_file example.
........
  r48563 | chris_kohlhoff | 2008-09-03 21:46:02 +1000 (Wed, 03 Sep 2008) | 2 lines
  
  Document BOOST_ASIO_DISABLE_EVENTFD macro.
........
  r48564 | chris_kohlhoff | 2008-09-03 21:54:06 +1000 (Wed, 03 Sep 2008) | 2 lines
  
  Add windows::overlapped_ptr to the reference index page.
........
  r48565 | chris_kohlhoff | 2008-09-03 22:28:07 +1000 (Wed, 03 Sep 2008) | 2 lines
  
  Regenerate documentation.
........
  r48683 | chris_kohlhoff | 2008-09-09 22:59:43 +1000 (Tue, 09 Sep 2008) | 2 lines
  
  Add windows example directory.
........
  r48684 | chris_kohlhoff | 2008-09-09 23:00:07 +1000 (Tue, 09 Sep 2008) | 2 lines
  
  Remove generated tags file.
........
  r48685 | chris_kohlhoff | 2008-09-09 23:01:16 +1000 (Tue, 09 Sep 2008) | 2 lines
  
  Version bump.
........
  r48686 | chris_kohlhoff | 2008-09-09 23:02:22 +1000 (Tue, 09 Sep 2008) | 2 lines
  
  Handle SSL library errors.
........
  r48715 | chris_kohlhoff | 2008-09-11 10:05:57 +1000 (Thu, 11 Sep 2008) | 2 lines
  
  Clarify which resolve functions perform forward or reverse resolution.
........


[SVN r49194]
2008-10-09 05:41:50 +00:00

282 lines
8.3 KiB
Plaintext

[/
/ Copyright (c) 2003-2008 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:using Using Boost.Asio]
[heading Supported Platforms]
The following platforms and compilers have been tested:
* Win32 and Win64 using Visual C++ 7.1 and Visual C++ 8.0.
* 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.
The following platforms may also work:
* AIX 5.3 using XL C/C++ v9.
* HP-UX 11i v3 using patched aC++ A.06.14.
* QNX Neutrino 6.3 using g++ 3.3 or later.
* Solaris using Sun Studio 11 or later.
* Tru64 v5.1 using Compaq C++ v7.1.
* Win32 using Borland C++ 5.9.2
[heading Dependencies]
The following libraries must be available in order to link programs that use
Boost.Asio:
* Boost.System for the `boost::system::error_code` and
`boost::system::system_error` classes.
* Boost.Regex (optional) if you use any of the [link
boost_asio.reference.read_until `read_until()`] or [link
boost_asio.reference.async_read_until `async_read_until()`] overloads that take
a `boost::regex` parameter.
* [@http://www.openssl.org OpenSSL] (optional) if you use Boost.Asio's SSL
support.
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 `-DBOOST_DATE_TIME_NO_LIB`
and `-DBOOST_REGEX_NO_LIB` to your project settings to disable autolinking of
the Boost.Date_Time and Boost.Regex libraries respectively. Alternatively, you
may choose to build these libraries and link to them.]
[heading Building Boost Libraries]
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:
[pre
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.
[/
[heading Compiling Programs With Boost.Asio]
Consider the following minimal Boost.Asio program [^simple.cpp]:
#include <boost/asio.hpp>
#include <iostream>
#include <ostream>
int main()
{
boost::asio::ip::tcp::iostream s("www.boost.org", "http");
s << "GET / HTTP/1.0\r\n";
s << "Host: www.boost.org\r\n";
s << "\r\n" << std::flush;
std::cout << s.rdbuf();
return 0;
}
The following compiler commands may be used to build the program (note that the
name of the `boost_system` library may vary depending on the compiler version):
[table
[
[OS]
[Compiler]
[Command]
]
[
[FreeBSD]
[g++]
[[^g++ -I['boost_root] -pthread simple.cpp -L['boost_root]/stage/lib -lboost_system-gcc]]
]
[
[Linux]
[g++]
[[^g++ -I['boost_root] -pthread simple.cpp -L['boost_root]/stage/lib -lboost_system-gcc41]]
]
[
[Mac OS X]
[g++]
[[^g++ -I['boost_root] simple.cpp -L['boost_root]/stage/lib -lboost_system]]
]
[
[Solaris]
[g++]
[[^g++ -I['boost_root] simple.cpp -L['boost_root]/stage/lib -lboost_system -lsocket -lnsl -lpthread]]
]
[
[Windows]
[MSVC 7.1]
[[^cl /EHsc /GR /MT -I['boost_root] /D_WIN32_WINNT=0x500 simple.cpp /link /libpath:['boost_root]/stage/lib]]
]
[
[Windows]
[MSVC 8.0]
[[^cl /EHsc /GR /MT /I['boost_root] /D_WIN32_WINNT=0x500 simple.cpp /link /libpath:['boost_root]/stage/lib]]
]
]
]
[heading Macros]
The macros listed in the table below may be used to control the behaviour of
Boost.Asio.
[table
[[Macro][Description]]
[
[`BOOST_ASIO_ENABLE_BUFFER_DEBUGGING`]
[
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
`BOOST_ASIO_DISABLE_BUFFER_DEBUGGING` has been defined.
When using g++, this macro is defined automatically if standard library
debugging is enabled (`_GLIBCXX_DEBUG` is defined), unless
`BOOST_ASIO_DISABLE_BUFFER_DEBUGGING` has been defined.
]
]
[
[`BOOST_ASIO_DISABLE_BUFFER_DEBUGGING`]
[
Explictly disables Boost.Asio's buffer debugging support.
]
]
[
[`BOOST_ASIO_DISABLE_DEV_POLL`]
[
Explicitly disables [^/dev/poll] support on Solaris, forcing the use of
a `select`-based implementation.
]
]
[
[`BOOST_ASIO_DISABLE_EPOLL`]
[
Explicitly disables `epoll` support on Linux, forcing the use of a
`select`-based implementation.
]
]
[
[`BOOST_ASIO_DISABLE_EVENTFD`]
[
Explicitly disables `eventfd` support on Linux, forcing the use of a
pipe to interrupt blocked epoll/select system calls.
]
]
[
[`BOOST_ASIO_DISABLE_KQUEUE`]
[
Explicitly disables `kqueue` support on Mac OS X and BSD variants,
forcing the use of a `select`-based implementation.
]
]
[
[`BOOST_ASIO_DISABLE_IOCP`]
[
Explicitly disables I/O completion ports support on Windows, forcing the
use of a `select`-based implementation.
]
]
[
[`BOOST_ASIO_NO_WIN32_LEAN_AND_MEAN`]
[
By default, Boost.Asio will automatically define `WIN32_LEAN_AND_MEAN` when
compiling for Windows, to minimise the number of Windows SDK header files
and features that are included. The presence of
`BOOST_ASIO_NO_WIN32_LEAN_AND_MEAN` prevents `WIN32_LEAN_AND_MEAN` from
being defined.
]
]
[
[`BOOST_ASIO_NO_DEFAULT_LINKED_LIBS`]
[
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. [^ws2_32.lib] and [^mswsock.lib], or [^ws2.lib] when
building for Windows CE). The `BOOST_ASIO_NO_DEFAULT_LINKED_LIBS` macro
prevents these libraries from being linked.
]
]
[
[`BOOST_ASIO_SOCKET_STREAMBUF_MAX_ARITY`]
[
Determines the maximum number of arguments that may be passed to the
`basic_socket_streambuf` class template's `connect` member function.
Defaults to 5.
]
]
[
[`BOOST_ASIO_SOCKET_IOSTREAM_MAX_ARITY`]
[
Determines the maximum number of arguments that may be passed to the
`basic_socket_iostream` class template's constructor and `connect` member
function. Defaults to 5.
]
]
[
[`BOOST_ASIO_ENABLE_CANCELIO`]
[
Enables use of the `CancelIo` function on older versions of Windows. If
not enabled, calls to `cancel()` on a socket object will always fail with
`asio::error::operation_not_supported` when run on Windows XP, Windows
Server 2003, and earlier versions of Windows. When running on Windows
Vista, Windows Server 2008, and later, the `CancelIoEx` function is
always used.
The `CancelIo` function has two issues that should be considered before
enabling its use:
* 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.
]
]
[
[`BOOST_ASIO_NO_TYPEID`]
[
Disables uses of the `typeid` operator in Boost.Asio. Defined
automatically if `BOOST_NO_TYPEID` is defined.
]
]
]
[heading Mailing List]
A mailing list specifically for Boost.Asio may be found on
[@http://sourceforge.net/mail/?group_id=122478 SourceForge.net]. Newsgroup
access is provided via [@http://dir.gmane.org/gmane.comp.lib.boost.asio.user
Gmane].
[endsect]