|
Boost-Commit : |
From: chris_at_[hidden]
Date: 2007-12-03 06:56:16
Author: chris_kohlhoff
Date: 2007-12-03 06:56:15 EST (Mon, 03 Dec 2007)
New Revision: 41640
URL: http://svn.boost.org/trac/boost/changeset/41640
Log:
Merge revisions 41407, 41432, 41477, 41478 from trunk.
Text files modified:
branches/release/boost/asio/detail/posix_fd_set_adapter.hpp | 13 +++-
branches/release/boost/asio/detail/reactor_op_queue.hpp | 7 ++
branches/release/boost/asio/detail/win_fd_set_adapter.hpp | 8 ++
branches/release/boost/asio/error.hpp | 7 ++
branches/release/libs/asio/doc/design/implementation.qbk | 6 -
branches/release/libs/asio/doc/using.qbk | 96 ++++++++++++++++++++++++++++++++++++++++
branches/release/libs/asio/test/ip/multicast.cpp | 20 +++++--
7 files changed, 138 insertions(+), 19 deletions(-)
Modified: branches/release/boost/asio/detail/posix_fd_set_adapter.hpp
==============================================================================
--- branches/release/boost/asio/detail/posix_fd_set_adapter.hpp (original)
+++ branches/release/boost/asio/detail/posix_fd_set_adapter.hpp 2007-12-03 06:56:15 EST (Mon, 03 Dec 2007)
@@ -36,11 +36,16 @@
FD_ZERO(&fd_set_);
}
- void set(socket_type descriptor)
+ bool set(socket_type descriptor)
{
- if (max_descriptor_ == invalid_socket || descriptor > max_descriptor_)
- max_descriptor_ = descriptor;
- FD_SET(descriptor, &fd_set_);
+ if (descriptor < FD_SETSIZE)
+ {
+ if (max_descriptor_ == invalid_socket || descriptor > max_descriptor_)
+ max_descriptor_ = descriptor;
+ FD_SET(descriptor, &fd_set_);
+ return true;
+ }
+ return false;
}
bool is_set(socket_type descriptor) const
Modified: branches/release/boost/asio/detail/reactor_op_queue.hpp
==============================================================================
--- branches/release/boost/asio/detail/reactor_op_queue.hpp (original)
+++ branches/release/boost/asio/detail/reactor_op_queue.hpp 2007-12-03 06:56:15 EST (Mon, 03 Dec 2007)
@@ -174,8 +174,13 @@
typename operation_map::iterator i = operations_.begin();
while (i != operations_.end())
{
- descriptors.set(i->first);
+ Descriptor descriptor = i->first;
++i;
+ if (!descriptors.set(descriptor))
+ {
+ boost::system::error_code ec(error::fd_set_failure);
+ dispatch_all_operations(descriptor, ec);
+ }
}
}
Modified: branches/release/boost/asio/detail/win_fd_set_adapter.hpp
==============================================================================
--- branches/release/boost/asio/detail/win_fd_set_adapter.hpp (original)
+++ branches/release/boost/asio/detail/win_fd_set_adapter.hpp 2007-12-03 06:56:15 EST (Mon, 03 Dec 2007)
@@ -37,13 +37,17 @@
fd_set_.fd_count = 0;
}
- void set(socket_type descriptor)
+ bool set(socket_type descriptor)
{
for (u_int i = 0; i < fd_set_.fd_count; ++i)
if (fd_set_.fd_array[i] == descriptor)
- return;
+ return true;
if (fd_set_.fd_count < win_fd_set_size)
+ {
fd_set_.fd_array[fd_set_.fd_count++] = descriptor;
+ return true;
+ }
+ return false;
}
bool is_set(socket_type descriptor) const
Modified: branches/release/boost/asio/error.hpp
==============================================================================
--- branches/release/boost/asio/error.hpp (original)
+++ branches/release/boost/asio/error.hpp 2007-12-03 06:56:15 EST (Mon, 03 Dec 2007)
@@ -195,7 +195,10 @@
eof,
/// Element not found.
- not_found
+ not_found,
+
+ /// The descriptor cannot fit into the select system call's fd_set.
+ fd_set_failure
};
enum ssl_errors
@@ -301,6 +304,8 @@
return "End of file";
if (value == error::not_found)
return "Element not found";
+ if (value == error::fd_set_failure)
+ return "The descriptor does not fit into the select call's fd_set";
return "asio.misc error";
}
};
Modified: branches/release/libs/asio/doc/design/implementation.qbk
==============================================================================
--- branches/release/libs/asio/doc/design/implementation.qbk (original)
+++ branches/release/libs/asio/doc/design/implementation.qbk 2007-12-03 06:56:15 EST (Mon, 03 Dec 2007)
@@ -194,8 +194,7 @@
* Uses overlapped I/O and I/O completion ports for all asynchronous socket
operations except for asynchronous connect.
-* Uses `select` for `deadline_timer` operations and for emulating asynchronous
-connect.
+* Uses `select` for emulating asynchronous connect.
Threads:
@@ -204,8 +203,7 @@
`io_service::poll_one()`.
* An additional thread per `io_service` is used for the `select`
-demultiplexing. This thread is created whenever the first `deadline_timer` is
-created, or on the first call to `async_connect()`.
+demultiplexing. This thread is created on the first call to `async_connect()`.
* An additional thread per `io_service` is used to emulate asynchronous host
resolution. This thread is created on the first call to either
Modified: branches/release/libs/asio/doc/using.qbk
==============================================================================
--- branches/release/libs/asio/doc/using.qbk (original)
+++ branches/release/libs/asio/doc/using.qbk 2007-12-03 06:56:15 EST (Mon, 03 Dec 2007)
@@ -130,4 +130,100 @@
]
+[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_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.
+ ]
+ ]
+]
+
[endsect]
Modified: branches/release/libs/asio/test/ip/multicast.cpp
==============================================================================
--- branches/release/libs/asio/test/ip/multicast.cpp (original)
+++ branches/release/libs/asio/test/ip/multicast.cpp 2007-12-03 06:56:15 EST (Mon, 03 Dec 2007)
@@ -106,7 +106,7 @@
#if defined(__hpux)
// HP-UX doesn't declare this function extern "C", so it is declared again here
-// to avoid a linker errors about an undefined symbol.
+// to avoid a linker error about an undefined symbol.
extern "C" unsigned int if_nametoindex(const char*);
#endif // defined(__hpux)
@@ -132,8 +132,16 @@
BOOST_CHECK(have_v4 || have_v6);
+#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
+ // Windows CE seems to have problems with some multicast group addresses.
+ // The following address works on CE, but as it is not a private multicast
+ // address it will not be used on other platforms.
+ const ip::address multicast_address_v4 =
+ ip::address::from_string("239.0.0.4", ec);
+#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
const ip::address multicast_address_v4 =
ip::address::from_string("239.255.0.1", ec);
+#endif // defined(BOOST_WINDOWS) && defined(UNDER_CE)
BOOST_CHECK(!have_v4 || !ec);
const ip::address multicast_address_v6 =
@@ -261,9 +269,8 @@
ip::multicast::enable_loopback enable_loopback2;
sock_v4.get_option(enable_loopback2, ec);
#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
- // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
- ec.value() << ", " << ec.message());
+ // Not supported under Windows CE but can get value.
+ BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
BOOST_CHECK(enable_loopback2.value());
@@ -287,9 +294,8 @@
ip::multicast::enable_loopback enable_loopback4;
sock_v4.get_option(enable_loopback4, ec);
#if defined(BOOST_WINDOWS) && defined(UNDER_CE)
- // Option is not supported under Windows CE.
- BOOST_CHECK_MESSAGE(ec == boost::asio::error::no_protocol_option,
- ec.value() << ", " << ec.message());
+ // Not supported under Windows CE but can get value.
+ BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
#else // defined(BOOST_WINDOWS) && defined(UNDER_CE)
BOOST_CHECK_MESSAGE(!ec, ec.value() << ", " << ec.message());
BOOST_CHECK(!enable_loopback4.value());
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk