Commit Graph

864 Commits

Author SHA1 Message Date
Vicente J. Botet Escriba
27896e9147 System/FileSystem/Asio/Thread: ref #7278 Added noexcept to Boost.System to conform with C++11
[SVN r81808]
2012-12-09 14:47:39 +00:00
Christopher Kohlhoff
355da949d5 Instead of using tie(), set the ios_base::unitbuf flag to force the stream to be flushed after every insertion. Refs #7162
[SVN r79710]
2012-07-23 23:52:15 +00:00
Christopher Kohlhoff
4d9e2461e0 Decorate GCC attribute names with underscores to prevent interaction with user-defined macros. Refs #6415
[SVN r79649]
2012-07-22 06:07:23 +00:00
Christopher Kohlhoff
b38937e17c Add missing #include of <cctype>, needed for some versions of MinGW.
[SVN r79648]
2012-07-22 06:05:26 +00:00
Christopher Kohlhoff
e00679b068 Use gcc's atomic builtins on arm, when available.
[SVN r79647]
2012-07-22 06:04:23 +00:00
Christopher Kohlhoff
7df5c95ca9 Ensure use of __thread keyword is disabled for older Intel compilers.
[SVN r79568]
2012-07-17 00:01:37 +00:00
Christopher Kohlhoff
cb65bde33b Sync version number with release branch.
[SVN r79551]
2012-07-16 06:29:59 +00:00
Christopher Kohlhoff
15b3e9a902 Make strand destruction a no-op, to allow strand objects to be destroyed after their associated io_service has been destroyed.
[SVN r79525]
2012-07-15 04:38:03 +00:00
Christopher Kohlhoff
8162904ea1 Use the __thread keyword extension when compiling with gcc on linux x86.
[SVN r79524]
2012-07-15 04:35:08 +00:00
Christopher Kohlhoff
fa10fb2fff Avoid calling work_finished() if a completion handler creates more work.
[SVN r79523]
2012-07-15 04:30:50 +00:00
Christopher Kohlhoff
8288819a86 Eliminate redundant call to call_stack::contains(this) when dispatching a completion handler.
[SVN r79522]
2012-07-15 04:26:05 +00:00
Christopher Kohlhoff
0736d31291 Add support for some newer versions of glibc which provide the epoll_create1 function but always fail with ENOSYS. Refs #7012
[SVN r79521]
2012-07-15 04:22:28 +00:00
Christopher Kohlhoff
b510b81b70 Use SSE2 load and store fences.
[SVN r79520]
2012-07-15 04:18:37 +00:00
Christopher Kohlhoff
5d4e191a92 Throw exception if SSL engine initialisation fails. Refs #6303
[SVN r79519]
2012-07-15 04:17:06 +00:00
Christopher Kohlhoff
91eea21a78 Fix another regression in buffered_write_stream. Refs #6310
[SVN r79518]
2012-07-15 04:10:59 +00:00
Christopher Kohlhoff
cf17fa2fc8 Use the thread's private_op_queue for handlers returned by the reactor task.
This fixes a problem where signal_set handlers are not being called when the
io_service's concurrency hint is set to 1. Refs #6657.


[SVN r78739]
2012-05-28 22:03:36 +00:00
Christopher Kohlhoff
5882dc476c Add support for g++ 4.7 when compiling in C++11 mode. Update revision history.
[SVN r78738]
2012-05-28 21:36:43 +00:00
Christopher Kohlhoff
b7c806fc78 Added lazy registration for EPOLLOUT.
[SVN r78667]
2012-05-26 22:28:34 +00:00
Christopher Kohlhoff
21d2df5acc Eliminate a lock/unlock pair when rescheduling a strand.
[SVN r78666]
2012-05-26 22:25:30 +00:00
Christopher Kohlhoff
69a388f92d Remove trailing whitespace.
[SVN r78665]
2012-05-26 22:23:53 +00:00
Christopher Kohlhoff
70598a8a58 Last version's race-condition-related revert in the epoll_reactor was
incomplete and broke out-of-band handling. Fixed epoll_reactor::start_op so
that it is now exactly the same as the older, working version.


[SVN r78664]
2012-05-26 22:22:46 +00:00
Christopher Kohlhoff
1fe87f03b4 Respect the OPENSSL_NO_ENGINE feature test #define.
[SVN r78663]
2012-05-26 22:20:47 +00:00
Christopher Kohlhoff
4806f0e274 Use correct basic_io_object member functions so that basic_object_handle works with c++11 compilers.
[SVN r78662]
2012-05-26 22:16:14 +00:00
Christopher Kohlhoff
b4e3ff2d9e Fixed a bug where the second buffer in an array of two buffers may be ignored
if the first buffer is empty.


[SVN r77033]
2012-02-15 22:16:53 +00:00
Christopher Kohlhoff
40608f9e0d Reverted earlier change to allow some speculative operations to be performed
without holding the lock, as it introduced a race condition in some
multithreaded scenarios.


[SVN r76990]
2012-02-12 12:53:06 +00:00
Christopher Kohlhoff
657c782117 Fix doxygen comments.
[SVN r76507]
2012-01-15 11:29:25 +00:00
Christopher Kohlhoff
be171b6abb Add extra include required for OVERLAPPED struct.
[SVN r76449]
2012-01-13 12:58:52 +00:00
Christopher Kohlhoff
c1a8562cf9 Disable object_handle on Windows CE.
[SVN r76448]
2012-01-13 12:57:59 +00:00
Christopher Kohlhoff
0725446de9 Fix non-paged pool "leak" on Windows when io_service is repeatedly run without anything to do. Refs #6321.
[SVN r76432]
2012-01-12 13:38:17 +00:00
Christopher Kohlhoff
c2d491a4e0 On linux, connect can return EAGAIN in certain circumstances. Remap to another
error so that it doesn't look like a non-blocking operation. Refs #6048.


[SVN r76430]
2012-01-12 12:27:02 +00:00
Christopher Kohlhoff
28fe058750 Fix deadlock on Mac OS X. Refs #6275.
[SVN r76427]
2012-01-12 10:08:15 +00:00
Christopher Kohlhoff
19da914b2c Fix regression in buffered_write_stream. Refs #6310.
[SVN r76426]
2012-01-12 07:42:47 +00:00
Christopher Kohlhoff
a132c47ca6 Fix for NetBSD. Refs #6098.
[SVN r76425]
2012-01-12 07:37:57 +00:00
Christopher Kohlhoff
d649b2acb8 Fix MSVC "performance warning".
[SVN r76424]
2012-01-12 07:30:05 +00:00
Christopher Kohlhoff
30f3e430a7 Update copyright notices.
[SVN r76420]
2012-01-11 23:04:08 +00:00
Christopher Kohlhoff
70cd19f75b Need to enable the basic_handle class when object_handle is supported.
[SVN r76408]
2012-01-11 07:10:06 +00:00
Christopher Kohlhoff
81f394e29d Added object_handle support.
[SVN r76397]
2012-01-10 09:58:05 +00:00
Christopher Kohlhoff
40316dfdb4 Chrono support.
[SVN r76380]
2012-01-09 13:43:38 +00:00
Christopher Kohlhoff
4badacaace Make number of strand implementations configurable by defining
BOOST_ASIO_STRAND_IMPLEMENTATIONS to the number.

Programs can now define BOOST_ASIO_ENABLE_SEQUENTIAL_STRAND_ALLOCATION to
switch the allocation of strand implementations to use a round-robin approach
rather than hashing.

Fix potential strand starvation issue that can occur when strand.post() is used.


[SVN r74955]
2011-10-15 23:59:12 +00:00
Christopher Kohlhoff
7e20d34537 Update descriptor state allocation to match approach used in epoll_reactor.
[SVN r74954]
2011-10-15 23:56:21 +00:00
Christopher Kohlhoff
fb588f5c1e Construct interrupter member first to fix exception safety issue. Refs #6006
[SVN r74953]
2011-10-15 23:55:24 +00:00
Christopher Kohlhoff
cc4f30f3b5 Clarify that the read operation ends when the buffer is full. Refs #5999
[SVN r74952]
2011-10-15 23:46:49 +00:00
Christopher Kohlhoff
c974f1088d Various performance improvements:
* Split the task_io_service's run and poll code.

* Use thread-local operation queues in single-threaded use cases (i.e. concurrency_hint is 1) to eliminate a lock/unlock pair.

* Only fence block exit when a handler is being run directly out of the io_service.

* Prefer x86 mfence-based fenced block when available.

* Use a plain ol' long for the atomic_count when all thread support is disabled.

* Allow some epoll_reactor speculative operations to be performed without holding the lock.

* Improve locality of reference by performing an 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 io_service.

* Pass same error_code variable through to each operation's complete() function.

* Optimise creation of and access to the io_service implementation.


[SVN r74826]
2011-10-08 21:58:10 +00:00
Christopher Kohlhoff
1882513c3e Fix error mapping when session is gracefully shut down.
[SVN r74825]
2011-10-08 21:38:43 +00:00
Christopher Kohlhoff
198913776d Initialise all OpenSSL algorithms.
[SVN r74824]
2011-10-08 21:38:08 +00:00
Christopher Kohlhoff
dd7f43285a Specialise operations for buffer sequences that are arrays of exactly two buffers.
[SVN r74823]
2011-10-08 21:36:36 +00:00
Christopher Kohlhoff
e66e5d5fb3 Fix crash due to gcc_x86_fenced_block that shows up when using the Intel C++ compiler. Refs #5763
[SVN r74822]
2011-10-08 21:31:26 +00:00
Christopher Kohlhoff
04b8773fd5 Disable warning due to const qualifier being applied to function type.
[SVN r74821]
2011-10-08 21:28:00 +00:00
Christopher Kohlhoff
8d24d33883 Set size of select fd_set at runtime when using Windows.
[SVN r74820]
2011-10-08 21:25:20 +00:00
Christopher Kohlhoff
21bbcdeae1 Make sure the synchronous null_buffers operations obey the user's non_blocking setting. Refs #5756
[SVN r74818]
2011-10-08 21:15:42 +00:00
Christopher Kohlhoff
35b91b411c Change the SSL buffers sizes so that they're large enough to hold a complete TLS record. Refs #5854
[SVN r74817]
2011-10-08 21:10:56 +00:00
Christopher Kohlhoff
292f6f53c9 Don't read the clock unless the heap is non-empty.
[SVN r74816]
2011-10-08 21:08:39 +00:00
Christopher Kohlhoff
701f7d68ab Explicitly specify the signal() function from the global namespace. Refs #5722
[SVN r74815]
2011-10-08 21:06:38 +00:00
Christopher Kohlhoff
b28a5bfcda Fix compile error in regex overload of async_read_until.hpp. Refs #5688
[SVN r74814]
2011-10-08 21:03:22 +00:00
Christopher Kohlhoff
df4b6cd4d6 Fix for static mutex initialisation.
[SVN r72818]
2011-06-30 13:38:30 +00:00
Christopher Kohlhoff
374c7b62a8 Zero-length reads and writes need to complete immediately.
[SVN r72807]
2011-06-29 23:35:17 +00:00
Christopher Kohlhoff
82cc1578b1 Fix include guard.
[SVN r72806]
2011-06-29 23:32:51 +00:00
Christopher Kohlhoff
2f5fcaf01c * Add documentation for new features.
* Duration type should be signed in tick_count_timer example.

* Regenerate documentation.

* Make definition of BOOST_ASIO_MOVE_ARG and BOOST_ASIO_MOVE_CAST separate to
  the definition of BOOST_ASIO_HAS_MOVE, to allow the latter to be user-defined.


[SVN r72404]
2011-06-05 13:29:41 +00:00
Christopher Kohlhoff
ee9089cea9 * Prevent truncation of some handler tracking output.
* Using directive only needed in write_line() function.


[SVN r72141]
2011-05-24 23:28:14 +00:00
Christopher Kohlhoff
da4617cc90 * Add move constructors and assignment operators to endpoint and address classes.
* Add support for platforms that have no signal support.

* Use using declarations when finding customisation hooks.


[SVN r72024]
2011-05-17 21:46:54 +00:00
Christopher Kohlhoff
9ec95f5fb0 Fix move-related bug in strand implementation. Refs #5515.
[SVN r71738]
2011-05-05 13:22:29 +00:00
Christopher Kohlhoff
64b410b2ca Updated move support.
[SVN r71708]
2011-05-04 00:02:18 +00:00
Christopher Kohlhoff
1a6b11f287 Changes for openssl 1.0.
[SVN r71706]
2011-05-03 23:55:03 +00:00
Christopher Kohlhoff
56ce545fda * Use variadic templates when supported.
* On Windows, ensure the count of outstanding work is decremented for
  abandoned operations (i.e. operations that are being cleaned up within
  the io_service destructor).

* Fix basic_socket_streambuf compile error when using MSVC 10's std::array.

* Preserve the value of errno across the signal handler.

* Fix unused return value warning.

* Fix various minor documentation errors.


[SVN r70751]
2011-03-30 12:58:14 +00:00
Christopher Kohlhoff
06747ea7c9 * Add documentation for new asio::buffer() overloads for std::array.
* Improve backward compatibility of the new SSL implementation.

* Add wrapper for SSL_CTX_set_default_verify_paths().

* Document which OpenSSL functions the ssl::context member functions use.

* Add SSL certificate verification callbacks, and add a new
  ssl::rfc2818_verification function object for simple peer certificate
  verification based on the host name.

* Use std::atomic<> when available.

* Prefer to use std::array when it is available.

* Use std::shared_ptr and std::weak_ptr when available.

* Use a lightweight scoped smart pointer.

* Fix some shadow variable warnings with g++ 4.6.


[SVN r70384]
2011-03-22 01:21:50 +00:00
Christopher Kohlhoff
9d47d1066b Fix error in doxygen comment. Regenerate documentation.
[SVN r70104]
2011-03-18 02:00:08 +00:00
Christopher Kohlhoff
ad1c100832 New SSL implementation.
[SVN r70096]
2011-03-18 00:25:54 +00:00
Christopher Kohlhoff
77d5583fe3 Add asio::buffer() overloads for std::array.
[SVN r70095]
2011-03-18 00:17:32 +00:00
Christopher Kohlhoff
8bd4e3a589 Remaining changes for asio 1.5.2:
* Added support for C++0x move construction and assignment to sockets, serial
  ports, POSIX descriptors and Windows handles.

* Regenerate documentation.


[SVN r70092]
2011-03-17 23:35:59 +00:00
Christopher Kohlhoff
d5ec01e6cc Don't assume SIGRTMAX is a compile-time constant.
[SVN r69516]
2011-03-03 11:56:32 +00:00
Christopher Kohlhoff
d41d2d15e9 * Add support for the fork() system call. Programs that use fork must call
io_service.notify_fork() at the appropriate times. Two new examples have been
  added showing how to use this feature. Refs #3238, #4162.

* Clean up the handling of errors reported by the close() system call. In
  particular, assume that most operating systems won't have close() fail with
  EWOULDBLOCK, but if it does then set blocking mode and restart the call. If
  any other error occurs we assume the descriptor is closed. Refs #3307.

* EV_ONESHOT seems to cause problems on some versions of Mac OS X, with the
  io_service destructor getting stuck inside the close() system call. Use
  EV_CLEAR instead. Refs #5021.

* Include function name in exception what() messages.

* Fix insufficient initialisers warning with MinGW.

* Make the shutdown_service() member functions private.

* Add archetypes for testing socket option functions.

* Add missing lock in signal_set_service::cancel().

* Fix copy/paste error in SignalHandler example.

* The signal header needs to be included in signal_set_service.hpp so that we
  can use constants like NSIG and SIGRTMAX.

* Don't use Boost.Thread's convenience header. Use the header file that is
  specifically for the boost::thread class instead.


[SVN r69467]
2011-03-02 08:27:32 +00:00
Christopher Kohlhoff
f064021b6d Changes for asio version 1.5.1:
* Added support for signal handling, using a new class called
  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_set objects, however the signal number
  must be used only with Asio.

* Added handler tracking, a new debugging aid. When enabled by defining
  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.pl] tool to create a visual
  representation of the handlers (requires GraphViz).

* Fixed a bug in asio::streambuf where the consume() function did not
  always update the internal buffer pointers correctly. The problem may
  occur when the asio::streambuf is 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
  read(), async_read(), read_until() or async_read_until().)

* Fixed a bug on kqueue-based platforms, where reactor read operations
  that return false from their perform() function are not correctly
  re-registered with kqueue.

* Modified the buffers_iterator<> and ip::basic_resolver_iterator
  classes so that the value_type typedefs are non-const byte types.


[SVN r69198]
2011-02-23 01:42:40 +00:00
Christopher Kohlhoff
7139b456d2 Changes for asio version 1.5.0:
* Added support for timeouts on socket iostreams, such as
  ip::tcp::iostream. A timeout is set by calling expires_at() or
  expires_from_now() to establish a deadline. Any socket operations
  which occur past the deadline will put the iostream into a bad state.

* Added a new error() member function to socket iostreams, for
  retrieving the error code from the most recent system call.

* Added a new basic_deadline_timer::cancel_one() function. This function
  lets you cancel a single waiting handler on a timer. Handlers are
  cancelled in FIFO order.

* Added a new 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.

* Added new free functions connect() and async_connect(). These
  operations try each endpoint in a list until the socket is
  successfully connected.

* Extended the buffer_size() function so that it works for buffer
  sequences in addition to individual buffers.

* Added a new buffer_copy() function that can be used to copy the raw
  bytes between individual buffers and buffer sequences.

* Added new non-throwing overloads of read(), read_at(), write() and
  write_at() that do not require a completion condition.

* Added friendlier compiler errors for when a completion handler does
  not meet the necessary type requirements. When C++0x is available
  (currently supported for g++ 4.5 or later, and MSVC 10), static_assert
  is also used to generate an informative error message. Checking may be
  disabled by defining BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS.

* Made the is_loopback(), is_unspecified() and is_multicast() functions
  consistently available across the ip::address, ip::address_v4 and
  ip::address_v6 classes. Refs #3939.

* Added new non_blocking() functions for managing the non-blocking
  behaviour of a socket or descriptor. The io_control() commands named
  non_blocking_io are now deprecated in favour of these new functions.

* Added new 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. Refs #3307.

* Added the io_control() member function for socket acceptors.
  Refs #3297.

* For consistency with the C++0x standard library, deprecated the
  native_type typedefs in favour of native_handle_type, and the native()
  member functions in favour of native_handle().

* Added a release() member function to posix descriptors. This function
  releases ownership of the underlying native descriptor to the caller.
  Refs #3900.

* Added support for sequenced packet sockets (SOCK_SEQPACKET).

* Added a new io_service::stopped() function that can be used to
  determine whether the io_service has stopped (i.e. a reset() call is
  needed prior to any further calls to run(), run_one(), poll() or
  poll_one()).

* Reduced the copying of handler function objects.

* Added support for C++0x move construction to further reduce copying of
  handler objects. Move support is enabled when compiling in -std=c++0x
  mode on g++ 4.5 or higher, or when using MSVC10.

* Removed the dependency on OS-provided macros for the well-known IPv4
  and IPv6 addresses. This should eliminate the annoying "missing braces
  around initializer" warnings. Refs #3741.

* Reduced the size of ip::basic_endpoint<> objects (such as
  ip::tcp::endpoint and ip::udp::endpoint).

* Changed the reactor backends to assume that any descriptors or sockets
  added using assign() may have been dup()-ed, and so require explicit
  deregistration from the reactor. Refs #4971.

* Changed the SSL error category to return error strings from the
  OpenSSL library.

* Changed the separate compilation support such that, to use Asio's SSL
  capabilities, you should also include 'asio/ssl/impl/src.hpp in one
  source file in your program.

* Removed the deprecated member functions named io_service(). The
  get_io_service() member functions should be used instead.

* Removed the deprecated typedefs resolver_query and resolver_iterator
  from the ip::tcp, ip::udp and ip::icmp classes.

* Fixed a compile error on some versions of g++ due to anonymous enums.
  Refs #4883.

* Added an explicit cast to the FIONBIO constant to int to suppress a
  compiler warning on some platforms. Refs #5128.

* Fixed warnings reported by g++'s -Wshadow compiler option. Refs #3905.


[SVN r69194]
2011-02-23 01:04:16 +00:00
Christopher Kohlhoff
20306c3852 Use correct interrupt method when timerfd is not available. Refs #5045
[SVN r68169]
2011-01-15 09:32:13 +00:00
Christopher Kohlhoff
4b019c3d1d Fix out-of-bounds address_v4::broadcast() return value on 64-bit systems.
[SVN r68088]
2011-01-13 09:13:30 +00:00
Christopher Kohlhoff
678d7ff74e Version bump.
[SVN r68087]
2011-01-13 09:09:09 +00:00
Christopher Kohlhoff
b1dced94c8 Update copyright notice.
[SVN r68086]
2011-01-13 08:14:05 +00:00
Bryce Adelstein-Lelbach
8f2012da28 Pathscale 4.0.0's stdlib (rw) has a <streambuf> that doesn't include <iostream>;
added an include to <iostream> here as this file needs it.



[SVN r67851]
2011-01-09 04:47:56 +00:00
Christopher Kohlhoff
3d76a5a994 Fixed a Windows-specific problem where failures from accept() are incorrectly treated as successes. Refs #4859.
[SVN r66613]
2010-11-16 13:16:45 +00:00
Christopher Kohlhoff
60724f91ab MacPorts gcc also defines __APPLE_CC__, but to 1.
[SVN r66398]
2010-11-04 11:40:42 +00:00
Christopher Kohlhoff
ddc92ac35f Target workaround at non-Apple objective-c++ compilers only, as the previous
workaround broke those platforms. Pragmas push_macro and pop_macro are only
available on gcc 4.4 or later, so use plain ol' #define/#undef instead.


[SVN r66289]
2010-10-30 22:45:29 +00:00
Christopher Kohlhoff
84ff434f23 Rename separate compilation header. Refs #4560.
[SVN r66174]
2010-10-25 12:26:06 +00:00
Christopher Kohlhoff
6fd0719fc4 Fix failure in socket_base test on NetBSD.
[SVN r66162]
2010-10-24 13:15:46 +00:00
Christopher Kohlhoff
24dade9009 Fix kqueue_reactor so that it compiles on NetBSD. Refs #4662.
[SVN r66159]
2010-10-24 07:58:23 +00:00
Christopher Kohlhoff
6fa2efadba Fix vector reallocation performance problem. Refs #4780.
[SVN r66158]
2010-10-24 02:06:46 +00:00
Christopher Kohlhoff
b4479ed01e Version check not required.
[SVN r66144]
2010-10-22 12:20:52 +00:00
Christopher Kohlhoff
5ea3ac4f9a Redefine Protocol and id to avoid clashing with Objective-C++ keywords. Refs #4191.
[SVN r66143]
2010-10-22 12:07:36 +00:00
Christopher Kohlhoff
25330ccc52 Fix unused parameter warnings.
[SVN r66075]
2010-10-18 12:27:12 +00:00
Christopher Kohlhoff
b12329f181 Fix so that read operations do not accept const_buffers_1 arguments. Refs #4746.
[SVN r66056]
2010-10-17 21:24:55 +00:00
Christopher Kohlhoff
f939fad2fc Version bump.
[SVN r66035]
2010-10-17 11:33:28 +00:00
Christopher Kohlhoff
99bb1215e2 Pass NULL for servname rather than empty string, as per POSIX. Refs #4690.
[SVN r66022]
2010-10-16 13:15:51 +00:00
Christopher Kohlhoff
056bbee611 Timers with expiry times set more than 5 minutes in the future need the
waitable timer to be periodic. Refs #4745.


[SVN r66020]
2010-10-16 12:59:29 +00:00
Christopher Kohlhoff
da63086d10 Fix Windows build when thread support is disabled. Refs #4680.
[SVN r66018]
2010-10-16 12:39:06 +00:00
Christopher Kohlhoff
e8a268059a Ensure handler arguments are passed as lvalues. Refs #4744.
[SVN r66017]
2010-10-16 12:23:56 +00:00
Christopher Kohlhoff
3518561c26 Always use pselect() on HP-UX, if it is available. Refs #4578.
[SVN r66014]
2010-10-16 11:39:13 +00:00
Christopher Kohlhoff
9a6c377a37 Add support for hardware flow control on QNX. Refs #4625.
[SVN r66010]
2010-10-16 11:04:08 +00:00
Christopher Kohlhoff
4fd6ef14e5 Check return code of InitializeCriticalSectionAndSpinCount. Refs #4574.
[SVN r66009]
2010-10-16 10:01:14 +00:00
Christopher Kohlhoff
37280f03dc Ensure close()/closesocket() failures are correctly propagated. Refs #4573.
[SVN r66008]
2010-10-16 09:47:11 +00:00
Christopher Kohlhoff
09cff6f060 Don't use deprecated system functions. Refs #4672.
[SVN r66007]
2010-10-16 07:24:47 +00:00
Christopher Kohlhoff
2c9c9b021f Use lower-case to keep MinGW cross-compilers happy. Refs #4491.
[SVN r66006]
2010-10-16 07:06:18 +00:00
Christopher Kohlhoff
61bec332e8 Fix a const-correctness issue that prevents valid uses of has_service<> from compiling. Refs #4638.
[SVN r66005]
2010-10-16 06:27:45 +00:00
Christopher Kohlhoff
efa8226a19 Fix the way the kqueue_reactor is interrupted when a new timer is scheduled. Refs #4568.
[SVN r66004]
2010-10-16 05:43:03 +00:00
Christopher Kohlhoff
e117752319 Version bump.
[SVN r63900]
2010-07-11 23:55:34 +00:00
Christopher Kohlhoff
0d86de5a45 Preserve error value.
[SVN r63838]
2010-07-11 04:16:10 +00:00
Christopher Kohlhoff
8832922873 Add macro for disabling fenced blocks.
[SVN r63837]
2010-07-11 04:15:19 +00:00
Christopher Kohlhoff
4bfc2868ab Note that hppa fence is just a placeholder at this time.
[SVN r63836]
2010-07-11 04:12:51 +00:00
Christopher Kohlhoff
2ddb60916c Fence class for hppa.
[SVN r63776]
2010-07-09 13:43:05 +00:00
Christopher Kohlhoff
6e0c4904b4 Add missing parameter.
[SVN r63646]
2010-07-05 07:43:22 +00:00
Christopher Kohlhoff
bd147ea789 Fix unused parameters.
[SVN r63594]
2010-07-04 13:42:41 +00:00
Christopher Kohlhoff
ae04d43d05 Add missing operator+ overload. Refs #4382.
[SVN r63592]
2010-07-04 13:11:14 +00:00
Christopher Kohlhoff
61e36a4a2b Eliminate unnecessary uses of hash_map.
[SVN r63577]
2010-07-04 07:37:42 +00:00
Christopher Kohlhoff
8c5627bc13 Make more tolerant of different platform sdk variants.
[SVN r63576]
2010-07-04 07:28:20 +00:00
Christopher Kohlhoff
5bd06414c5 Fixes in non_blocking_read.
[SVN r63575]
2010-07-04 07:26:36 +00:00
Christopher Kohlhoff
5ae3eae4d5 Add cancellation of reactor operations.
[SVN r63574]
2010-07-04 07:23:27 +00:00
Christopher Kohlhoff
c983fc805e Fix forward declaration.
[SVN r63573]
2010-07-04 07:21:24 +00:00
Christopher Kohlhoff
bf07247104 Fences for arm.
[SVN r63572]
2010-07-04 07:20:18 +00:00
Christopher Kohlhoff
c8146d544f Fences for arm.
[SVN r63571]
2010-07-04 07:19:30 +00:00
Christopher Kohlhoff
7ead504f73 Ensure arguments to handlers are passed as const types.
[SVN r63570]
2010-07-04 06:57:32 +00:00
Christopher Kohlhoff
db6f42e12b Fix handling of empty buffer sequences.
[SVN r62558]
2010-06-08 11:01:57 +00:00
Christopher Kohlhoff
5978853196 Ensure unsigned char is used with isdigit. Refs #4201.
[SVN r62556]
2010-06-08 09:01:39 +00:00
Christopher Kohlhoff
c1d13d05f8 Some changes for Symbian support.
[SVN r62531]
2010-06-07 23:29:05 +00:00
Christopher Kohlhoff
579be49842 Fixes for MSVC 7.1, Borland.
[SVN r62530]
2010-06-07 23:24:28 +00:00
Christopher Kohlhoff
0f5629d445 Reworked implementation MkII
[SVN r62499]
2010-06-07 00:00:45 +00:00
Christopher Kohlhoff
b7bc3ff637 Fix handling of small but non-zero timeouts. Fixes #4205.
[SVN r62497]
2010-06-06 23:28:58 +00:00
Christopher Kohlhoff
33eeb63378 Doc updates.
[SVN r61643]
2010-04-28 12:39:06 +00:00
Christopher Kohlhoff
b59ac3d388 Try using asm-based fenced block for pathscale.
[SVN r61172]
2010-04-10 06:54:34 +00:00
Christopher Kohlhoff
58ca677b0f Try to fix compile errors on various platforms in fenced_block.
[SVN r61010]
2010-04-03 00:29:06 +00:00
Christopher Kohlhoff
03645c054c Add ifdef to allow asio's threading support to be independently disabled.
[SVN r61009]
2010-04-02 22:51:42 +00:00
Christopher Kohlhoff
5dbcf53b17 Fix so that lock is not held while reactor is running.
[SVN r60962]
2010-03-31 12:22:10 +00:00
Christopher Kohlhoff
51ae6ad776 Uncomment ifdef test that was accidentally left commented.
[SVN r60961]
2010-03-31 12:13:47 +00:00
Christopher Kohlhoff
d3a2b42be1 New kqueue reactor implementation using one-shot event registration.
[SVN r60940]
2010-03-30 12:31:51 +00:00
Christopher Kohlhoff
1ea2d5330f Don't perform a speculative read when an out-of-band read is pending.
[SVN r60939]
2010-03-30 12:30:00 +00:00
Christopher Kohlhoff
d02eb70ec9 Don't allow speculative reads when message_out_of_band is specified.
[SVN r60938]
2010-03-30 12:28:22 +00:00
Christopher Kohlhoff
f1debcc472 Document basic_resolver_query's constructor arguments.
[SVN r60921]
2010-03-29 23:51:15 +00:00
Christopher Kohlhoff
399786e737 Fix unused variable warnings.
[SVN r60883]
2010-03-27 23:04:56 +00:00
Christopher Kohlhoff
7b4fabf4e3 Change the resolver implementation to no longer require the typedefs
InternetProtocol::resolver_query and InternetProtocol::resolver_iterator,
as neither typedef is part of the documented InternetProtocol requirements.

The following typedefs are now marked as deprecated:
- ip::icmp::resolver_query
- ip::icmp::resolver_iterator
- ip::tcp::resolver_query
- ip::tcp::resolver_iterator
- ip::udp::resolver_query
- ip::udp::resolver_iterator


[SVN r60882]
2010-03-27 22:22:59 +00:00
Christopher Kohlhoff
d32559c643 Always call ioctl on underlying descriptor when modifying blocking mode. Refs #3307.
[SVN r60869]
2010-03-27 10:54:44 +00:00
Christopher Kohlhoff
3c5fe939c9 Async connect operations using the reactor should not allow speculative
completion.


[SVN r60781]
2010-03-23 01:39:12 +00:00
Christopher Kohlhoff
41bcacc9e2 Fix cancellation in Windows HANDLE backend.
[SVN r60756]
2010-03-22 03:32:56 +00:00
Christopher Kohlhoff
c980da5515 Fix search/replace error in some resolver_query_base enumerators.
[SVN r60743]
2010-03-21 10:54:56 +00:00
Christopher Kohlhoff
73b7b61c61 Fix cancellation.
[SVN r60723]
2010-03-19 23:58:48 +00:00
Christopher Kohlhoff
e95406e8b9 WinCE doesn't provide InitializeCriticalSectionAndSpinCount.
[SVN r60722]
2010-03-19 23:57:50 +00:00
Christopher Kohlhoff
4ab0d73c10 Fix epoll_reactor bug where cancelled operations would complete with a
"success" error_code.


[SVN r60705]
2010-03-19 13:08:04 +00:00
Christopher Kohlhoff
1683a90e86 Fix bug where 0-byte reads were incorrectly passing an eof error_code to the handler. Refs #4023.
[SVN r60689]
2010-03-18 11:08:19 +00:00
Christopher Kohlhoff
96ad484574 Use a bitmask type for the resolver flags, as per the TR2 proposal. This will
prevent implicit conversion from int to flags, allowing the compiler to catch
cases where users incorrectly pass a numeric port number as the service name.


[SVN r60687]
2010-03-18 06:23:38 +00:00
Christopher Kohlhoff
481e0b03d9 Clarify that to_bytes() returns addresses in network byte order. Refs #4005.
[SVN r60683]
2010-03-18 01:54:43 +00:00
Christopher Kohlhoff
8717cac135 Define NOMINMAX for all Windows compilers, not just Cygwin. Users can define
BOOST_ASIO_NO_NOMINMAX to suppress this definition.


[SVN r60681]
2010-03-18 01:32:34 +00:00
Christopher Kohlhoff
96ce1bea3f Reworked implementation.
[SVN r60380]
2010-03-09 12:50:07 +00:00
Christopher Kohlhoff
eecd73a23a Document ordering of handlers in strands. Fix error in streambuf snippet.
[SVN r59104]
2010-01-17 21:48:17 +00:00
Christopher Kohlhoff
d6ac7e4a70 Support platforms that don't define INET6_ADDRSTRLEN. Refs #3743.
[SVN r58793]
2010-01-07 22:18:16 +00:00
Christopher Kohlhoff
dd13ae0801 Disable handler allocation and invocation hooks on g++ 2.x. Refs #3743.
[SVN r58782]
2010-01-06 22:44:48 +00:00
Christopher Kohlhoff
23c3bacde4 Apply fix for reported excessive CPU usage under Solaris. Refs #3670.
[SVN r58762]
2010-01-06 12:36:51 +00:00
Christopher Kohlhoff
b031423afe Disable iostreams-related functionality if BOOST_NO_IOSTREAMS is defined. Refs #3743.
[SVN r58761]
2010-01-06 12:27:05 +00:00
Christopher Kohlhoff
ec92795b73 Use buffer debugging workaround with MSVC 8 only.
[SVN r58740]
2010-01-06 02:38:39 +00:00
Christopher Kohlhoff
fb9262b171 Use sockatmark if SIOCATMARK is not defined. Refs #3743.
[SVN r58705]
2010-01-05 12:50:39 +00:00
Christopher Kohlhoff
a53c811edb Drop back to second_clock if microsec_clock is unavailable. Refs #3743.
[SVN r58704]
2010-01-05 12:20:10 +00:00
Christopher Kohlhoff
05161f352f Include boost/limits.hpp rather than <limits>, to support older compilers.
Refs #3743.


[SVN r58703]
2010-01-05 11:51:41 +00:00
Christopher Kohlhoff
e918b97ec4 Fix Win64 warnings.
[SVN r58671]
2010-01-04 12:33:42 +00:00
Christopher Kohlhoff
cf516b07a5 Only include implementation headers required for each platform.
[SVN r58652]
2010-01-02 21:38:44 +00:00
Christopher Kohlhoff
c37cae6c1c Add a workaround for some broken Windows firewalls that make a socket
appear bound to 0.0.0.0 when it is in fact bound to 127.0.0.1.


[SVN r58651]
2010-01-02 21:37:10 +00:00
Christopher Kohlhoff
51b0750d54 In getaddrinfo emulation, only check the socket type (SOCK_STREAM or SOCK_DGRAM)
if a service name has been specified. This should allow the emulation to work
with raw sockets.


[SVN r58650]
2010-01-02 21:35:33 +00:00
Christopher Kohlhoff
c2f12c99e0 Use a pool of strand implementations to make copying of strands cheaper.
[SVN r58647]
2010-01-02 20:36:59 +00:00
Christopher Kohlhoff
b5688e37a7 Add boost_ prefix to extern "C" thread entry point function. Refs #3809.
[SVN r58630]
2010-01-02 10:30:41 +00:00
Christopher Kohlhoff
6d8d57aaf0 Ensure that kqueue support is enabled for BSD platforms. Refs #3626.
[SVN r58629]
2010-01-02 10:20:12 +00:00
Christopher Kohlhoff
cf8c031f87 Don't block signals while performing system calls, but instead restart the
calls if they are interrupted.


[SVN r58628]
2010-01-02 09:48:01 +00:00
Christopher Kohlhoff
45acb2f756 Use boost::addressof to get the address of handler objects, rather than
applying operator& directly. Refs #2977.


[SVN r58627]
2010-01-02 08:24:12 +00:00
Christopher Kohlhoff
ee7f4cba38 e specific type_traits headers.
[SVN r58625]
2010-01-02 07:16:41 +00:00
Christopher Kohlhoff
b6fbb66440 Windows needs the OVERLAPPED structure to be valid until both the initiating
function call has returned and the completion packet has been delivered.


[SVN r58624]
2010-01-02 06:09:02 +00:00
Christopher Kohlhoff
20a822c591 Update copyright notices.
[SVN r58623]
2010-01-02 01:24:52 +00:00
Christopher Kohlhoff
c901425aa0 Wrap long line.
[SVN r58621]
2010-01-01 23:04:35 +00:00
Hartmut Kaiser
afa4f59dbb Asio: disabled VC workaround for VC2010 beta2 compiler
[SVN r57393]
2009-11-05 00:26:15 +00:00
Christopher Kohlhoff
58ad4eec91 Clarify that deadline_timer uses a UTC-based clock by default.
[SVN r55670]
2009-08-19 22:44:02 +00:00
Christopher Kohlhoff
328b1a37bf Add missing returns for failure cases in write_some_at and read_some_at.
[SVN r55500]
2009-08-10 11:38:00 +00:00
Christopher Kohlhoff
9b5be8f373 Fix bullet list.
[SVN r55059]
2009-07-21 12:20:28 +00:00
Christopher Kohlhoff
e325c6ffe3 Documentation updates.
[SVN r54916]
2009-07-13 03:38:21 +00:00
Christopher Kohlhoff
ab1a6a09ff Fix compile error when using openssl 1.0 beta. Refs #3256.
[SVN r54907]
2009-07-12 08:16:06 +00:00
Christopher Kohlhoff
5cafa35a16 Don't write to /dev/poll descriptor when there are no pending changes.
[SVN r54845]
2009-07-09 22:58:26 +00:00
Christopher Kohlhoff
261c3962c0 Fix task initialisation.
[SVN r54844]
2009-07-09 22:55:26 +00:00
Christopher Kohlhoff
7f27c0a3a7 Check that WINVER is actually defined when using it.
[SVN r54526]
2009-06-30 08:22:03 +00:00
Christopher Kohlhoff
487d4241b2 Don't rehash if the number of buckets hasn't changed.
[SVN r54525]
2009-06-30 08:19:56 +00:00
Christopher Kohlhoff
4f1faaa224 Sync version number with release branch.
[SVN r54501]
2009-06-29 13:52:31 +00:00
Christopher Kohlhoff
eacb3aefde Treat 0-byte reads and writes as no-ops to comply with the documented type
requirements for SyncReadStream, AsyncReadStream, SyncWriteStream and
AsyncWriteStream.


[SVN r54467]
2009-06-28 13:20:17 +00:00
Christopher Kohlhoff
dcb95b393b Use boost::throw_exception() rather than throw keyword to allow asio to be
used when exception support is disabled. Note that the SSL wrappers still
require exception support. Refs #2754.


[SVN r54400]
2009-06-27 07:52:11 +00:00
Christopher Kohlhoff
fd411319a4 Fix various g++ warnings. Ref #1341.
[SVN r54393]
2009-06-27 07:07:40 +00:00
Christopher Kohlhoff
f36045ab00 Fix custom memory allocation for timers. Ref #3107.
[SVN r54392]
2009-06-27 05:24:16 +00:00
Christopher Kohlhoff
2e4474765b Fix failures reported when the tests are built with _GLIBCXX_DEBUG. Ref #3098.
[SVN r54390]
2009-06-27 02:17:49 +00:00
Christopher Kohlhoff
3ec5f6ed71 Remove a local variable that was hiding the ec parameter and preventing
error codes from being correctly propagated. Ref #3216.


[SVN r54377]
2009-06-26 13:55:24 +00:00
Christopher Kohlhoff
486c8e7931 Fix bug in hash resize. Ref #3095.
[SVN r54376]
2009-06-26 13:35:04 +00:00
Christopher Kohlhoff
c48aa55815 Don't include termios.h unless BOOST_ASIO_HAS_SERIAL_PORT is defined.
Fixes #2917.


[SVN r52478]
2009-04-19 04:15:17 +00:00
Christopher Kohlhoff
1f9ec4a8da POSIX allows successful system calls to modify errno, so always clear the
error_code if the result indicates success. Fixes #2953.


[SVN r52465]
2009-04-18 13:27:53 +00:00
Christopher Kohlhoff
b79f9a65cd Specifically handle the case when an overlapped ReadFile call fails with
ERROR_MORE_DATA. This enables a hack where a windows::stream_handle can be
used with a message-oriented named pipe.


[SVN r52419]
2009-04-16 12:31:27 +00:00
Christopher Kohlhoff
21f70c436b Fix incompatibility between asio and ncurses.h due to the latter defining
a macro called "timeout". Fixes #2156.


[SVN r52412]
2009-04-16 03:27:58 +00:00
Christopher Kohlhoff
0218c0b06b Fix implementation of io_control() so that it adheres to the type
requirements for IoControlCommand. Fixes #2820.


[SVN r52294]
2009-04-09 12:16:02 +00:00
Christopher Kohlhoff
6408f73a8f Prevent memory leaks when an async SSL operation's completion handler throws.
Fixes #2910.


[SVN r52293]
2009-04-09 12:12:50 +00:00
Christopher Kohlhoff
ab2dd63bbe Implement automatic resizing of the bucket array in the internal hash maps.
This is to improve performance for very large numbers of asynchronous
operations and also to reduce memory usage for very small numbers. A new
macro BOOST_ASIO_HASH_MAP_BUCKETS may be used to tweak the sizes used for the
bucket arrays.


[SVN r52292]
2009-04-09 12:09:16 +00:00
Christopher Kohlhoff
5816e90bdb As a performance optimisation, add an explicit check for an empty vector of
timer queues.


[SVN r52291]
2009-04-09 12:04:39 +00:00
Christopher Kohlhoff
28e59ef71c Fix some warnings that occur with MSVC at warning level 4. Fixes #2828.
[SVN r52290]
2009-04-09 12:03:01 +00:00
Christopher Kohlhoff
59a8830f00 Correct documentation of read, read_at, write and write_at functions to
match new CompletionCondition concept. Fixes #2871.


[SVN r52289]
2009-04-09 12:00:36 +00:00
Christopher Kohlhoff
2c6b839435 Prevent locales from affecting the formatting of endpoints. Fixes #2682.
[SVN r52288]
2009-04-09 11:50:42 +00:00
Christopher Kohlhoff
6ce058b229 Update asio version number.
[SVN r50964]
2009-02-02 09:37:10 +00:00
Christopher Kohlhoff
3d9eada294 Use the workaround syntax for specifying a return type with boost::bind.
Needed for the SSL support to work on some older compilers (in particular,
g++ 3.4.5 as used with MinGW).


[SVN r50963]
2009-02-02 09:36:11 +00:00
Christopher Kohlhoff
d7a448832d Use a pipe if eventfd is not supported at runtime. Fixes #2683.
[SVN r50961]
2009-02-02 06:18:59 +00:00
Christopher Kohlhoff
82ed5cb275 Clear the last error following a successful Windows API call, since some
socket providers may leave last error set even when the call succeeds.


[SVN r50949]
2009-02-01 13:25:05 +00:00
Christopher Kohlhoff
774b96f4b5 Add include of <cstring> to fix a compile error on Solaris 10. Fixes #2607.
[SVN r50948]
2009-02-01 12:50:08 +00:00
Christopher Kohlhoff
d53f078c45 Ensure arguments to windows::overlapped_ptr::complete() are passed through to
the completion handler. Fixes #2614.


[SVN r50947]
2009-02-01 12:41:01 +00:00
Christopher Kohlhoff
0d15139621 Suppress unused result warning. Fixes #2534.
[SVN r50946]
2009-02-01 12:28:12 +00:00
Christopher Kohlhoff
1a99da8a0b Improve warning message when _WIN32_WINNT is not correctly defined. Fixes #2541.
[SVN r50945]
2009-02-01 11:57:01 +00:00
Christopher Kohlhoff
94696dfc48 Use correct size for IP_MULTICAST_LOOP option on QNX. Fixes #2530.
[SVN r50944]
2009-02-01 11:42:09 +00:00
Christopher Kohlhoff
9d8581df70 Add more documentation for asio::streambuf.
[SVN r49497]
2008-10-31 01:09:45 +00:00
Christopher Kohlhoff
0c1aea1ebf Fix scoped_ptr usage to work with Sun Studio 11.
[SVN r49484]
2008-10-29 13:00:24 +00:00
Christopher Kohlhoff
96fcff70f2 Fix problem in read_until's match_condition handling when the delimiter
lies at the end of the data.


[SVN r49482]
2008-10-29 12:49:05 +00:00
Christopher Kohlhoff
f2ae35573e Reduce memory usage by doing lazy initialisation of the io_service's reactor.
[SVN r49203]
2008-10-09 06:39:05 +00:00
Christopher Kohlhoff
a64e08daf8 Make the service_registry's usage of typeid work when the default gcc
linker visibility is set to hidden.


[SVN r49202]
2008-10-09 06:34:48 +00:00
Christopher Kohlhoff
b06aeaea60 Only use TerminateThread when explicitly requested by the user by calling
asio::detail:🧵:set_terminate_threads(true). This fixes a memory leak
that may occur with internally created threads.


[SVN r49201]
2008-10-09 06:33:34 +00:00
Christopher Kohlhoff
70ced27ea0 Fix basic_socket_streambuf to work with Protocol objects that don't
provide a resolver.


[SVN r49199]
2008-10-09 06:31:01 +00:00
Christopher Kohlhoff
67a930a268 Ensure the streambuf's egptr() is kept in sync the pptr(). Use std::memmove
rather than std::rotate to minimise data copying. Avoid unnecessary resizes
of the underlying vector.


[SVN r49198]
2008-10-09 06:30:16 +00:00
Christopher Kohlhoff
15b7cb1e8a Merge codegear changes from non-boost version of asio.
[SVN r49197]
2008-10-09 06:28:39 +00:00
Christopher Kohlhoff
d67d33cd9b Add missing bounds checks as specified in TR2 proposal.
[SVN r49195]
2008-10-09 06:22:58 +00:00
Nicola Musatti
32da68bc8e Patch from Ticket #2372
[SVN r49155]
2008-10-06 21:46:14 +00:00
Christopher Kohlhoff
7d25f1c393 Clarify which resolve functions perform forward or reverse resolution.
[SVN r48715]
2008-09-11 00:05:57 +00:00
Christopher Kohlhoff
a746a264d3 Handle SSL library errors.
[SVN r48686]
2008-09-09 13:02:22 +00:00
Christopher Kohlhoff
557ca7cebf Version bump.
[SVN r48685]
2008-09-09 13:01:16 +00:00
Christopher Kohlhoff
68b4f9d710 Update completion_condition documentation to match new signature.
[SVN r48561]
2008-09-03 09:08:04 +00:00
Christopher Kohlhoff
295d977d78 Explicitly specify return type with bind to keep some compilers happy.
[SVN r48560]
2008-09-03 09:06:10 +00:00
Christopher Kohlhoff
a2af9824d6 Add a workaround for a possible gcc 4.3 optimiser bug.
[SVN r48559]
2008-09-03 08:57:48 +00:00
Christopher Kohlhoff
76bf08631f Oops, changeset 48535 accidentally reverted 48527's fix.
[SVN r48558]
2008-09-03 08:56:43 +00:00
Christopher Kohlhoff
aea347d0a7 Add const overloads of the lowest_layer member functions.
[SVN r48535]
2008-09-02 11:34:18 +00:00
Christopher Kohlhoff
f5caaa00d2 Fix to compile with MSVC 7.1.
[SVN r48527]
2008-09-02 08:46:46 +00:00
Christopher Kohlhoff
687fe8806f Use templates to handle iovec structures that have an iov_base member of
type char*.


[SVN r48525]
2008-09-01 23:05:05 +00:00
Christopher Kohlhoff
c60ebedd28 Add support for using an eventfd descriptor on linux to interrupt a blocked
epoll/select reactor.


[SVN r48524]
2008-09-01 23:04:35 +00:00
Christopher Kohlhoff
4696ee9033 Add class to allow use of arbitrary Windows overlapped I/O operations.
[SVN r48495]
2008-08-31 11:38:52 +00:00
Christopher Kohlhoff
7176a41d0d Refactor reactive socket implementation so that synchronous read, write,
accept and connect operations don't modify data associated with the socket.


[SVN r48491]
2008-08-31 09:01:59 +00:00
Christopher Kohlhoff
bb6bfd4b5a 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.


[SVN r48418]
2008-08-28 12:11:47 +00:00
Christopher Kohlhoff
05bf3b8195 Fix duplicate variable warning. Use get_io_service() rather than
deprecated io_service() function.


[SVN r48416]
2008-08-28 12:06:42 +00:00
Christopher Kohlhoff
94292f1605 Fix duplicate variable warning.
[SVN r48415]
2008-08-28 12:04:21 +00:00
Christopher Kohlhoff
7387044863 Fix uninitialised event handles in asio::detail::thread in external mode.
[SVN r48414]
2008-08-28 12:03:46 +00:00
Christopher Kohlhoff
302ca4f79d Update version to match release.
[SVN r48410]
2008-08-28 09:04:31 +00:00
Christopher Kohlhoff
8b4057a004 Include CREAD and CLOCAL in the default flags for serial ports.
[SVN r48039]
2008-08-09 01:47:11 +00:00
Christopher Kohlhoff
a81db41dbc QNX defines AI_V4MAPPED, AI_ALL and AI_ADDRCONFIG but does not implement them.
[SVN r48033]
2008-08-08 14:49:23 +00:00
Christopher Kohlhoff
0b693c585c Fix memory leak in use_tmp_dh_file().
[SVN r48032]
2008-08-08 14:48:24 +00:00
Christopher Kohlhoff
71d47ca98c Fix a tight spin on epoll (or /dev/poll) that occurs when the EPOLLERR and
EPOLLHUP events are reported for a descriptor and there are no pending
operations.


[SVN r48031]
2008-08-08 14:47:58 +00:00
Christopher Kohlhoff
2d79a40ae6 Correct an array bounds error in the treatment of paths for UNIX domain sockets.
Fixes #2120.


[SVN r47673]
2008-07-22 08:26:35 +00:00
Christopher Kohlhoff
285f3e5246 Fix SSL thread ID function to work correctly on 64-bit Windows.
[SVN r47218]
2008-07-08 12:31:48 +00:00
Christopher Kohlhoff
c8899c13a0 POSIX platforms are not required to define IOV_MAX, so if it's not
available default to the stipulated minimum of 16.


[SVN r47217]
2008-07-08 12:30:49 +00:00
Christopher Kohlhoff
479a3abd98 Version bump.
[SVN r47014]
2008-07-02 22:52:22 +00:00
Christopher Kohlhoff
e14e831413 Clarify behaviour of read_until/async_read_until with respect to leftover
data in the streambuf. Use separate brief descriptions for function groups.
Add some extra notes to the io_service documentation.


[SVN r46950]
2008-07-01 12:14:57 +00:00
Christopher Kohlhoff
4123435aa2 Improve buffer() documentation. Fix vector overloads to match TR2 proposal.
[SVN r46949]
2008-07-01 12:13:51 +00:00
Christopher Kohlhoff
e8c7f33c05 Fix name of parameter as referred to in documentation.
[SVN r46945]
2008-07-01 11:53:54 +00:00
Christopher Kohlhoff
39f9567e78 Fix documentation on behaviour when a connect operation fails.
[SVN r46944]
2008-07-01 11:52:54 +00:00
Christopher Kohlhoff
03fc0e7dd6 One more check needed for BSD serial port extensions.
[SVN r46535]
2008-06-20 00:25:50 +00:00
Christopher Kohlhoff
ffe21c73a2 Fix serial port support on POSIX platforms that don't provide the BSD
extensions cfmakeraw, cfsetspeed and CRTSCTS.


[SVN r46507]
2008-06-19 12:50:02 +00:00
Christopher Kohlhoff
6e1c421d72 Fix for unicode builds.
[SVN r46506]
2008-06-19 12:41:32 +00:00
Christopher Kohlhoff
43e62310b6 Add new overloads for read_until and async_read_until that invoke a
user-defined function object to determine when a match has been found.


[SVN r46475]
2008-06-18 13:03:46 +00:00
Christopher Kohlhoff
2d5f24d6ae Fix write_at declaration. Add missing documentation for offset parameters.
[SVN r46473]
2008-06-18 11:22:21 +00:00
Christopher Kohlhoff
1539f2c8a1 Add an iterator for bytewise traversal of a buffer sequence.
[SVN r46415]
2008-06-16 00:41:29 +00:00
Christopher Kohlhoff
2d4504e512 Only perform check for a 0-byte receive meaning EOF on SOCK_STREAM sockets.
[SVN r46327]
2008-06-11 13:07:41 +00:00
Christopher Kohlhoff
cac7fe6350 Remove repeated typedef of reactor_type.
[SVN r46325]
2008-06-11 12:41:48 +00:00
Christopher Kohlhoff
fa82af9e16 Add random-access handles for use on Windows.
[SVN r46319]
2008-06-11 11:17:53 +00:00
Christopher Kohlhoff
7e062f298d Add support for serial ports.
[SVN r46272]
2008-06-09 12:54:55 +00:00
Christopher Kohlhoff
f3ee6627d8 Fix a deadlock that can occur when destroying a thread object with global
lifetime in a dynamically loaded DLL on Windows. Note that deadlock can
still occur if the thread is launched by the constructor of an object with
global lifetime.


[SVN r45935]
2008-05-30 08:39:19 +00:00
Christopher Kohlhoff
56b93eea3a Fix a crash that can occur when destroying a handler object that owns its
own memory (as is the case when destroying handlers in an orphaned strand).


[SVN r45811]
2008-05-27 07:54:12 +00:00
Christopher Kohlhoff
ac762e87b9 Some Windows platforms don't define IPPROTO_ICMPV6.
[SVN r45633]
2008-05-21 22:56:49 +00:00
Christopher Kohlhoff
e011561170 Implement custom allocation support for timer operations.
[SVN r45600]
2008-05-21 09:25:12 +00:00
Christopher Kohlhoff
db608c4370 Add check for empty heap when determining the minimum wait duration for a
timer queue.


[SVN r45355]
2008-05-14 12:17:26 +00:00
Christopher Kohlhoff
40fd64673f Use an atomic counter for strand reference counting.
[SVN r45179]
2008-05-06 22:09:47 +00:00
Christopher Kohlhoff
f4b17b0fda Implement custom memory allocation support for reactor-based asynchronous operations.
[SVN r45122]
2008-05-05 06:30:13 +00:00
Christopher Kohlhoff
09272f1402 Add fast-pathing of speculative reads and writes to the kqueue_reactor.
[SVN r45059]
2008-05-03 11:36:16 +00:00
Christopher Kohlhoff
a89f7596cf Don't use the names readv and writev for functions defined inside asio as
these names seem to be macros on Tru64.


[SVN r45010]
2008-05-02 08:38:15 +00:00
Christopher Kohlhoff
7acfc68a3a A memory barrier is needed on some platforms to ensure that all updates
to the node occur before the tail pointer is updated.


[SVN r44998]
2008-05-01 22:27:21 +00:00
Christopher Kohlhoff
ee366184d6 Add a fast path for some speculative read and write operations in the
epoll_reactor.


[SVN r44997]
2008-05-01 22:00:26 +00:00
Christopher Kohlhoff
a34a1413ca Add an experimental two-lock queue implementation for task_io_service.
[SVN r44851]
2008-04-28 13:56:07 +00:00
Christopher Kohlhoff
23c4f7061d Add raw socket support.
[SVN r44849]
2008-04-28 13:36:18 +00:00
Christopher Kohlhoff
bfda1481e0 Update asio version number.
[SVN r44848]
2008-04-28 13:35:27 +00:00
Christopher Kohlhoff
8768d9dff1 Fix or suppress MSVC level 4 warnings. Fixes #1703.
[SVN r44727]
2008-04-22 23:46:15 +00:00
Christopher Kohlhoff
482e083b76 Remove a local variable that was hiding the ec parameter and preventing
error codes from being correctly propagated. Fixes #1820.


[SVN r44679]
2008-04-21 05:52:20 +00:00
Christopher Kohlhoff
ee449aa163 Add new wrapper classes for stream-oriented handles on Windows.
[SVN r44676]
2008-04-21 05:32:34 +00:00
Christopher Kohlhoff
1ef42e04c6 Add new wrapper classes for stream-oriented file descriptors on POSIX platforms.
[SVN r44675]
2008-04-21 05:16:15 +00:00
Christopher Kohlhoff
f784e54ced Add support for UNIX domain sockets.
[SVN r44674]
2008-04-21 04:43:05 +00:00
Christopher Kohlhoff
a277af13a5 Add a special null_buffers type that allows read and write operations to
be used to indicate the socket's readiness to read or write without
blocking.


[SVN r44673]
2008-04-21 04:02:37 +00:00
Christopher Kohlhoff
5d44c01796 Improve documentation for the protected functions and data in basic_io_object<>.
[SVN r44670]
2008-04-21 02:01:34 +00:00
Christopher Kohlhoff
2ae65fbd27 Fix infinite recursion in the ssl::stream's shutdown() implementation.
[SVN r44668]
2008-04-21 01:42:10 +00:00
Christopher Kohlhoff
1a12b931f9 Update version number to match release.
[SVN r44667]
2008-04-21 01:41:29 +00:00
Christopher Kohlhoff
9af5979e38 Improve efficiency of basic_streambuf::consume() by using a single call to
gbump() rather than calling sbumpc() in a loop.


[SVN r44666]
2008-04-21 01:39:06 +00:00
Christopher Kohlhoff
ee4e432de1 Ensure that timer dispatching responsibility is correctly relinquished when
processing leftover interrupts from a previous run invocation.


[SVN r44663]
2008-04-21 01:27:48 +00:00
Christopher Kohlhoff
64b08a01c4 Add ability to disable the uses of the typeid operator by defining
BOOST_NO_TYPEID or BOOST_ASIO_NO_TYPEID.


[SVN r44662]
2008-04-21 01:23:42 +00:00
Christopher Kohlhoff
5ba249c3d1 Fix double-free error that occurs when an exception is thrown from a
handler that has been dispatched (i.e. not posted) through a strand.


[SVN r43879]
2008-03-27 14:18:07 +00:00
Christopher Kohlhoff
adab7d88e0 Fix incorrect use of sin_port with a sockaddr_in6 structure.
[SVN r43586]
2008-03-13 06:59:02 +00:00
Christopher Kohlhoff
7c43ea9399 Use unions to fix a sockaddr_storage aliasing problem that shows up with
g++ 4.3.0.


[SVN r43570]
2008-03-12 13:26:41 +00:00
Christopher Kohlhoff
301f79a384 Revert to having the windows-bug workaround (short timeout on
GetQueuedCompletionStatus) on all threads as there are still scenarios
where threads can get stuck indefinitely.


[SVN r43569]
2008-03-12 13:25:49 +00:00
Christopher Kohlhoff
f99a3cb814 Update copyright notices.
[SVN r43472]
2008-03-03 14:05:35 +00:00
Christopher Kohlhoff
7df2a57eef Add missing 'boost_' prefix to helper namespace.
[SVN r43470]
2008-03-03 13:27:06 +00:00
Christopher Kohlhoff
002ebea1e3 Disable use of CancelIo by default, due to the possibility of silent
failure on some system configurations. Swallow error returned by CancelIoEx
if there are no operations to be cancelled.


[SVN r43469]
2008-03-03 13:21:05 +00:00
Christopher Kohlhoff
61bcc0b5ec Add missing tie().
[SVN r43437]
2008-02-29 12:57:57 +00:00
Christopher Kohlhoff
5b09097082 Use the correct vector of timer queues when dispatching timers.
[SVN r43377]
2008-02-22 22:43:54 +00:00
Christopher Kohlhoff
8e218007b0 Add missing #include of socket_types.hpp needed for the SSL unit tests
to compile successfully on Windows.


[SVN r43303]
2008-02-18 13:35:15 +00:00
Christopher Kohlhoff
697ef44e1c The latest Windows SDKs don't support IPv6 when building for Windows 2000,
so we need to use the SDK emulation in that case.


[SVN r43056]
2008-02-02 12:02:23 +00:00
Christopher Kohlhoff
57f75e9a24 Fix "possible loss of data" warning when building for Windows 2000 targets.
[SVN r43055]
2008-02-02 11:39:17 +00:00
Christopher Kohlhoff
f50757120a Ensure that the workaround for the MSVC secure iterator problem is only
used when compiling with MSVC. The workaround causes g++'s library debug
mode to report errors due to the assignment from a singular iterator.


[SVN r43054]
2008-02-02 11:37:45 +00:00
Christopher Kohlhoff
0b26077356 Set the openssl callback function for getting a thread ID.
[SVN r42817]
2008-01-16 13:46:01 +00:00
Christopher Kohlhoff
1f215cd262 Check for truncation when converting buffer size from size_t to openssl's
int argument.

Try to fix possible thread-safety issues in SSL wrapper.


[SVN r42759]
2008-01-14 13:29:08 +00:00
Christopher Kohlhoff
0841027789 Silence some integer truncation warnings.
Only perform the windows-bug workaround where we use a short timeout with
GetQueuedCompletionStatus from one thread, i.e. the timer thread.

Keep track of the number of OVERLAPPED-derived operations to ensure that
they all get cleaned up when the io_service is destroyed.


[SVN r42758]
2008-01-14 13:27:52 +00:00
Christopher Kohlhoff
95e7a5a83f Silence some integer truncation warnings.
[SVN r42756]
2008-01-14 13:25:24 +00:00
Christopher Kohlhoff
d02ff9fd31 Don't call epoll_wait/kevent if there are no old operations (where old means
added prior to the last epoll_wait/kevent call) needing to be demultiplexed.


[SVN r42755]
2008-01-14 13:24:28 +00:00
Christopher Kohlhoff
66e7e8235b Disable noisy and incorrect /Wp64 warnings generated by MSVC.
[SVN r42754]
2008-01-14 13:22:21 +00:00
Christopher Kohlhoff
0481bc277b Don't include sys/time.h when compiling with aCC, as that header does not
supply pselect(), which is needed for HP-UX/aCC to work correctly.


[SVN r42753]
2008-01-14 13:21:37 +00:00
Christopher Kohlhoff
e73e772d7f Add missing broken pipe error.
[SVN r42752]
2008-01-14 13:20:06 +00:00
Christopher Kohlhoff
30db47b9f8 Documentation fixes.
[SVN r42121]
2007-12-17 13:17:46 +00:00
Christopher Kohlhoff
197952d66b Bump version number.
[SVN r42120]
2007-12-17 13:08:10 +00:00
Christopher Kohlhoff
808e0862ba Fixes for older HP-UX.
[SVN r42119]
2007-12-17 13:04:30 +00:00
Christopher Kohlhoff
931e25063d Suppress signed/unsigned warning.
[SVN r41868]
2007-12-08 13:48:52 +00:00
Christopher Kohlhoff
8d4d725277 Try to fix stall when sending large amounts of data over SSL.
[SVN r41823]
2007-12-07 12:53:39 +00:00
Christopher Kohlhoff
1c123accd8 Don't use deprecated function workaround when compiling for Windows CE.
[SVN r41762]
2007-12-05 21:46:19 +00:00
Christopher Kohlhoff
312551ab47 Prevent deprecated function warnings for MSVC >= 8.
[SVN r41701]
2007-12-04 21:28:42 +00:00
Christopher Kohlhoff
1172215e3d Make async operations fail with an error if the socket descriptor doesn't
fit into the select call's fd_set.


[SVN r41432]
2007-11-28 13:26:33 +00:00
Beman Dawes
7ba40bdcb8 // Add or correct comment identifying Boost library this header is associated with.
[SVN r41173]
2007-11-17 20:13:16 +00:00
Christopher Kohlhoff
5c14db353b Try to fix an order-of-initialisation problem with error_category references.
The symptom, which only occurs in some applications, is a crash due to a
dereference of a null pointer. The exact conditions under which the problem
occurs are not fully understood, so this fix is probably more paranoid than
necessary.


[SVN r41100]
2007-11-15 06:19:04 +00:00
Christopher Kohlhoff
45add4d11e Add a workaround for MSVC secure iterator problem where allowing the
destruction of an iterator to an already-destroyed string object results in
a program crash. Revert previous change to destroy buffers prior to
invoking the handler since it didn't fix the problem and wasn't cleaning
up all copies of the buffers anyway.


[SVN r41059]
2007-11-13 12:50:27 +00:00
Christopher Kohlhoff
970375748c Cannot perform concurrent operations on the /dev/poll descriptor where
the sockets descriptors involved may already be being waited on. Changed
the dev_poll_reactor class to keep a vector of pending event changes and
interrupt the /dev/poll ioctl() wait to apply it.


[SVN r41028]
2007-11-12 12:07:39 +00:00
Christopher Kohlhoff
7de155b732 Fix timer stalls.
[SVN r40924]
2007-11-08 07:52:49 +00:00
Christopher Kohlhoff
1086746c7d Eliminate the need for an extra thread to perform timer dispatching.
[SVN r40919]
2007-11-08 04:10:14 +00:00
Christopher Kohlhoff
556cbac864 Don't set errno when building for Windows targets. Should fix WinCE build.
[SVN r40779]
2007-11-05 11:52:52 +00:00
Christopher Kohlhoff
6e1a010a72 Some changes to enable support for WinCE.
[SVN r40759]
2007-11-04 21:25:49 +00:00
Christopher Kohlhoff
9db4bb6bc0 Fix memory leak when an io_service is allowed to destruct with unfinished
async_wait operations.


[SVN r40670]
2007-11-01 22:42:26 +00:00
Christopher Kohlhoff
d306f9dafe Use GetModuleHandleA rather than GetModuleHandle to avoid being broken by
UNICODE #defines.


[SVN r40548]
2007-10-29 13:07:08 +00:00
Christopher Kohlhoff
3787272722 Ensure the task handler is put back on the queue after polling.
[SVN r40547]
2007-10-29 13:06:39 +00:00
Christopher Kohlhoff
644ed0fa71 Mac OS X 10.5 (Leopard) gives a compile error if you try to perform an
operation on a const fd_set pointer.


[SVN r40546]
2007-10-29 13:06:12 +00:00
Christopher Kohlhoff
72198ee954 Fixes for HP-UX test failures.
[SVN r40413]
2007-10-24 13:23:59 +00:00
Christopher Kohlhoff
cca0c50ca1 Documentation fixes.
[SVN r40345]
2007-10-23 08:09:46 +00:00
Christopher Kohlhoff
4915994d7c Only use pselect() when compiling with aCC.
[SVN r40344]
2007-10-23 08:09:21 +00:00
Christopher Kohlhoff
1122c04976 Fix address_v6::operator<.
[SVN r40263]
2007-10-21 08:13:21 +00:00
Christopher Kohlhoff
46191ad216 Use an unsigned char for the enable_loopback socket option on HP-UX.
[SVN r40261]
2007-10-21 07:30:04 +00:00
Christopher Kohlhoff
9df40d565a On HP-UX use pselect() rather than select() to avoid weirdness where
different select() prototypes are declared depending on the order the
system headers are included.


[SVN r40259]
2007-10-21 07:09:19 +00:00
Christopher Kohlhoff
a694fc7ba7 Documentation fixes.
[SVN r40256]
2007-10-21 05:46:47 +00:00
Christopher Kohlhoff
827c767b80 HP-UX fails to declare if_nametoindex and if_indextoname as extern "C".
Added declarations for them with correct linkage to avoid linker errors.


[SVN r40255]
2007-10-21 05:46:15 +00:00
Christopher Kohlhoff
9f6bab9893 Ensure the buffers and completion condition objects are destroyed before
the completion handler is invoked.


[SVN r40241]
2007-10-21 01:48:03 +00:00
Christopher Kohlhoff
811d967f52 Add get_io_service() synonym for io_service() to match TR2 proposal.
[SVN r40176]
2007-10-19 08:09:55 +00:00
Christopher Kohlhoff
b4384805aa Assume that Tru64 also needs SIGPIPE to be blocked.
[SVN r40149]
2007-10-18 08:34:03 +00:00
Christopher Kohlhoff
14d49a688a Add dummy enum for ssl errors. Change to static const references to error
category objects to be consistent with boost.system.


[SVN r40119]
2007-10-17 14:04:42 +00:00
Christopher Kohlhoff
5af39ab4ef Make Windows XP the default target Windows version as the latest Windows
SDK doesn't support IPv6 for Windows 2000 targets.


[SVN r40108]
2007-10-17 07:58:38 +00:00
Christopher Kohlhoff
bd35039449 Throw an exception if unable to create a pipe for the pipe_select_interrupter.
[SVN r40107]
2007-10-17 07:25:03 +00:00
Christopher Kohlhoff
87cfb10267 Borland C++ wants friendship for the task_cleanup nested class.
[SVN r40106]
2007-10-17 05:22:26 +00:00
Christopher Kohlhoff
2865a15b93 Revert HP-UX/aCC change to select() wrapper as it breaks more than it fixes.
[SVN r40104]
2007-10-17 04:44:38 +00:00
Christopher Kohlhoff
9fc86e1351 Add a /dev/poll reactor implementation for Solaris.
[SVN r39913]
2007-10-10 23:12:06 +00:00
Christopher Kohlhoff
96a6faa937 HP-UX with aCC uses a variant of select() that takes int* arguments rather
than fd_set*.


[SVN r39864]
2007-10-09 21:47:40 +00:00
Christopher Kohlhoff
4fa7155b45 Assume that HP-UX and AIX both need to have SIGPIPE blocked.
[SVN r39863]
2007-10-09 21:47:07 +00:00
Christopher Kohlhoff
ddbb696058 The epoll_wait function can produce EPOLLHUP events for a descriptor even
if not specifically requested, resulting in a tight loop of calls to
epoll_wait. Delete a descriptor from epoll if an EPOLLHUP event is
received and there are no registered operations for the descriptor.


[SVN r39752]
2007-10-07 00:11:25 +00:00
Christopher Kohlhoff
27ad77577b Try using an unsigned char for the multicast::enable_loopback socket option
when compiling for Tru64.


[SVN r39665]
2007-10-03 01:43:08 +00:00
Christopher Kohlhoff
e52d0569e1 Add missing #include needed for MinGW.
[SVN r39664]
2007-10-03 01:40:55 +00:00
Christopher Kohlhoff
fe53d29503 Fix warning on AIX about omitted 'private' keyword when deriving from noncopyable.
[SVN r39507]
2007-09-24 13:29:12 +00:00
Christopher Kohlhoff
331beee1a6 Check whether exceptions are enabled on the output iostream and throw or not
throw errors accordingly.


[SVN r39504]
2007-09-24 13:21:03 +00:00
Christopher Kohlhoff
e5c82d221a Try making the ip::multicast::enable_loopback socket option an unsigned char on AIX.
[SVN r39503]
2007-09-24 13:19:31 +00:00
Christopher Kohlhoff
cad9b88130 Strict compilers don't like it when you pass a function with C linkage
as an argument when the parameter type has C++ linkage. Try using the type
of the msghdr::msg_namelen field as an alternative way of deducing the
socklen_t-equivalent type.


[SVN r39443]
2007-09-21 12:34:19 +00:00
Christopher Kohlhoff
1837283e91 Eliminate use of types and structure members that may not be present when
build for non-XOPEN targets.


[SVN r39432]
2007-09-20 22:33:29 +00:00
Christopher Kohlhoff
7e67ec6336 Some compilers require namespace-scope declarations of use_service,
has_service and add_service.


[SVN r39431]
2007-09-20 22:30:54 +00:00
Christopher Kohlhoff
ae79df6318 Move handler queue management to a separate class.
[SVN r39430]
2007-09-20 22:26:55 +00:00
Christopher Kohlhoff
d61cf1e0b8 Larger storage size needed for Windows x64.
[SVN r39429]
2007-09-20 22:20:57 +00:00
Christopher Kohlhoff
50e479d4ab Fix unused argument warning.
[SVN r39364]
2007-09-18 13:13:40 +00:00
Christopher Kohlhoff
520f11ff1b AIX seems to have the socket address family as an unsigned char rather than unsigned short.
[SVN r39211]
2007-09-12 12:24:21 +00:00
Christopher Kohlhoff
3e05da91c1 Use enum-based error code constants.
[SVN r39189]
2007-09-11 11:17:56 +00:00
Christopher Kohlhoff
a79f4c70ea Fix problem where a thread can go idle even if there are handlers that are
ready to be dispatched.

Remove need to have a mutex per idle thread.

Remove need to have a mutex per idle thread.


[SVN r39098]
2007-09-01 06:41:15 +00:00
Christopher Kohlhoff
2a61b8a501 Add #include needed for IOV_MAX.
[SVN r39097]
2007-09-01 06:33:44 +00:00
Christopher Kohlhoff
817fe44ac4 Ensure that a strand is kept alive as long as there are wrapped handlers
for it.


[SVN r39096]
2007-09-01 06:28:40 +00:00
Christopher Kohlhoff
992d80498d Add AIX-specific compile time test for whether sockaddr_storage's family
field is called ss_family or __ss_family.


[SVN r39095]
2007-09-01 06:25:55 +00:00
Christopher Kohlhoff
71d9f010a8 Enable buffer() overload workaround for Sun C++.
[SVN r39094]
2007-09-01 06:20:19 +00:00
Christopher Kohlhoff
9df7f38577 Fix unused argument warnings.
[SVN r38791]
2007-08-20 14:32:05 +00:00
Christopher Kohlhoff
78d7795fba Increase number of buffers that may be sent or received in a single operation.
Clean up win_iocp_socket_service's close-on-destruction handling to ensure
non-blocking socket destructors.


[SVN r38788]
2007-08-20 14:17:15 +00:00
Christopher Kohlhoff
984fd932d6 Fix unused argument warning.
[SVN r38787]
2007-08-20 14:12:31 +00:00
Christopher Kohlhoff
69310edc3c Fix order of initialisation problem with error categories.
[SVN r38786]
2007-08-20 14:11:46 +00:00
Christopher Kohlhoff
989ff8a599 Add missing static keyword to the service_id_matches functions.
[SVN r38785]
2007-08-20 14:08:16 +00:00
Christopher Kohlhoff
25fa47276c Add a workaround for Windows Vista's handling of the boolean socket option
tcp::no_delay, where ::getsockopt will return the size of the option as one
byte, even though a four byte integer was passed in.


[SVN r38784]
2007-08-20 14:07:23 +00:00
Christopher Kohlhoff
4d914fcd64 Add a note to basic_socket<>::close() indicating that shutdown() should
be used for portable graceful closure.


[SVN r38783]
2007-08-20 13:53:27 +00:00
Christopher Kohlhoff
b98a841fa6 Improve documentation for completion condition objects.
[SVN r38323]
2007-07-31 11:39:30 +00:00
Christopher Kohlhoff
0a42306700 Always restart epoll_reactor operations if the callback handler indicates
that they should be restarted, even if there was an error associated with
the file descriptor, to ensure that operations don't get "lost".

Don't cleanup pending timer objects while the reactor lock is held, since
the destructors for the objects may try to make calls back into the
reactor.


[SVN r38322]
2007-07-31 11:36:10 +00:00
Christopher Kohlhoff
e12b0141a6 Eliminate spurious warning for MSVC8 when using /W4 and /Wp64.
[SVN r38321]
2007-07-31 11:35:00 +00:00
Christopher Kohlhoff
dac0aa7f77 Need to include socket_types.hpp for definition of _WIN32_WINNT.
[SVN r38320]
2007-07-31 11:34:12 +00:00
Christopher Kohlhoff
788d350ec5 Don't cleanup pending timer objects while the reactor lock is held, since
the destructors for the objects may try to make calls back into the
reactor.


[SVN r38319]
2007-07-31 11:33:29 +00:00
Christopher Kohlhoff
3f41710b85 Add support for the non-POSIX getaddrinfo errors EAI_NODATA and
EAI_ADDRFAMILY.


[SVN r38318]
2007-07-31 11:32:49 +00:00
Christopher Kohlhoff
3cb6db7cae Don't perform debug check with 0-sized buffers.
[SVN r38053]
2007-06-21 23:29:19 +00:00
Christopher Kohlhoff
86a79bede3 Add missing error message.
[SVN r37798]
2007-05-27 08:04:32 +00:00
Christopher Kohlhoff
65e054db78 Work around mysterious Borland C++ bug that prevents getsockopt and
setsockopt from working correctly.


[SVN r37734]
2007-05-21 13:05:06 +00:00
Christopher Kohlhoff
1742d2e664 Documentation fixes.
[SVN r37720]
2007-05-20 01:04:11 +00:00
Christopher Kohlhoff
cbba2f8ecd Documentation updates.
[SVN r37718]
2007-05-20 00:30:54 +00:00
Christopher Kohlhoff
463b06e4b0 To get portable behaviour for SO_REUSEADDR with UDP, the Mac OS X and BSD
platforms also need SO_REUSEPORT to be set.


[SVN r37717]
2007-05-20 00:28:55 +00:00
Christopher Kohlhoff
68b94f2dc0 Need to enable SO_NOSIGPIPE option on FreeBSD.
[SVN r37715]
2007-05-20 00:28:13 +00:00
Christopher Kohlhoff
899d252fb9 Allow everything to compile on platforms where IPV6_V6ONLY is not defined
(such as Linux distros with a 2.4 kernel), but make any use of ip::v6_only
fail at runtime.


[SVN r37681]
2007-05-13 08:18:09 +00:00
Christopher Kohlhoff
972c54ba27 Preserve the user-set blocking mode over an async connect.
[SVN r37673]
2007-05-12 10:48:24 +00:00
Christopher Kohlhoff
75dd9fdefe Need to define IPV6_UNICAST_HOPS when building with an old Platform SDK.
[SVN r37672]
2007-05-12 10:48:01 +00:00
Christopher Kohlhoff
41bf5929d3 Zero out address structure to prevent failures on some platforms.
[SVN r37671]
2007-05-12 10:47:15 +00:00
Christopher Kohlhoff
9ec1d04a0b Some older UNIX platforms return EPROTO from accept() to indicate that a
connection was lost before being fully established.


[SVN r37670]
2007-05-12 10:46:47 +00:00
Christopher Kohlhoff
cbe0de5634 Add documentation note specifying that pending handlers are still executed
after a strand is destroyed.


[SVN r37632]
2007-05-08 13:40:08 +00:00
Christopher Kohlhoff
05518d58e6 Ensure internal non-blocking flag is set if the user wants non-blocking.
[SVN r37631]
2007-05-08 13:39:04 +00:00
Christopher Kohlhoff
288b994d9b Add header file containing Boost.Asio version number.
[SVN r37628]
2007-05-08 12:20:38 +00:00
Christopher Kohlhoff
66424c1579 Clarify behaviour of io_service::run() in a thread pool.
[SVN r37606]
2007-05-06 22:36:18 +00:00
Christopher Kohlhoff
c64a2dbdaa Fix ip::multicast::enable_loopback option so that it works on Solaris.
[SVN r37605]
2007-05-06 22:35:35 +00:00
Christopher Kohlhoff
8437b8a23f Fix bug in timer heap management.
[SVN r37483]
2007-04-22 07:42:59 +00:00
Christopher Kohlhoff
18dcdcb3ab Enable buffer debugging for g++ when _GLIBCXX_DEBUG is defined.
[SVN r37482]
2007-04-22 07:41:54 +00:00
Christopher Kohlhoff
d926a9054f Don't copy a default-constructed vector iterator.
[SVN r37481]
2007-04-22 07:38:55 +00:00
Christopher Kohlhoff
905e8594fb Fix comments.
[SVN r37389]
2007-04-07 08:54:58 +00:00
Christopher Kohlhoff
4667159f1c Fix problem where the safe_cancellation_thread_id_ was not being calculated
correctly.


[SVN r37388]
2007-04-07 08:50:42 +00:00
Christopher Kohlhoff
2fc7b8e99c Fix libstdc++ debug error.
[SVN r37387]
2007-04-07 08:48:12 +00:00
Christopher Kohlhoff
bafa5a3c7a Some fixes for Solaris, AIX and HP-UX.
[SVN r37020]
2007-02-20 13:19:53 +00:00
Christopher Kohlhoff
f8af480754 Fix crash in comparison of service ids.
[SVN r37018]
2007-02-20 13:15:08 +00:00
Christopher Kohlhoff
adf40110f9 Solaris defines FD_ZERO to use an unqualified call to memset, so we need to
make the function visible using 'using namespace std'.


[SVN r36938]
2007-02-13 07:15:36 +00:00
Christopher Kohlhoff
0d4ccec23f Fix use of hash_value overloads to work on x64 with the Vista version of
the Platform SDK.


[SVN r36917]
2007-02-09 06:44:12 +00:00
Christopher Kohlhoff
6267a27180 Fix to correctly clear error after successful call of WSAAddresstoString or
WSAStringToAddress.


[SVN r36916]
2007-02-09 06:43:00 +00:00
Christopher Kohlhoff
bb236cb7b3 Add is_open() function to acceptor.
[SVN r36915]
2007-02-09 06:41:29 +00:00
Christopher Kohlhoff
3fb401181e Use IN6ADDR_ANY_INIT rather than IPPROTO_IPV6 to detect whether the Windows
Platform SDK supports IPv6, since the Vista Platform SDK has changed
IPPROTO_IPV6 to an enum.


[SVN r36904]
2007-02-06 22:34:02 +00:00
Christopher Kohlhoff
44b862a24a Workaround is needed for BDS2006.
[SVN r36903]
2007-02-06 22:23:48 +00:00
Christopher Kohlhoff
2520c84cd0 Update basic_socket_streambuf and basic_socket_iostream to (almost) match
the TR2 proposal.


[SVN r36753]
2007-01-19 01:09:33 +00:00
Christopher Kohlhoff
39f2ce8d45 Add ability to turn iostream output buffering off.
[SVN r36730]
2007-01-15 07:43:01 +00:00
Christopher Kohlhoff
2212dddb1f Automatically break large buffers into smaller chunks when using read(),
async_read(), write() or async_write().


[SVN r36724]
2007-01-13 23:17:41 +00:00
Christopher Kohlhoff
0c536811ff The misc_ecat error category now needs to be available for Win32 builds.
[SVN r36718]
2007-01-13 12:27:06 +00:00
Christopher Kohlhoff
7db5f2d133 Fix bug where the io_service could incorrectly run out of work (and so shut
down) when an overlapped I/O function fails immediately.


[SVN r36717]
2007-01-13 12:21:01 +00:00
Christopher Kohlhoff
4ee1510c76 Update socket interfaces to match TR2 proposal.
[SVN r36675]
2007-01-09 13:54:51 +00:00
Christopher Kohlhoff
282a9f2146 Update timer classes to match TR2 proposal.
[SVN r36663]
2007-01-08 03:01:13 +00:00
Christopher Kohlhoff
1a72ddb9a7 Update io_service interface to match TR2 proposal.
[SVN r36662]
2007-01-08 01:30:05 +00:00
Christopher Kohlhoff
06402569d5 Update the behaviour of the asio::streambuf overloads of {async_}read and
{async_}read_until to match the TR2 proposal.


[SVN r36636]
2007-01-07 08:26:18 +00:00
Christopher Kohlhoff
5607a01c21 Add ip::unicast::hops and ip::v6_only socket options.
[SVN r36595]
2007-01-06 09:10:54 +00:00
Christopher Kohlhoff
6c632c2967 Fix examples to match current socket option interface.
[SVN r36594]
2007-01-06 09:08:13 +00:00
Christopher Kohlhoff
66dd4c3778 Rename const_buffer_container_1 to const_buffers_1 and
mutable_buffer_container_1 to mutable_buffers_1.


[SVN r36585]
2007-01-04 10:45:09 +00:00
Christopher Kohlhoff
a7209ee0be Rename io_service::interrupt() to io_service::stop().
[SVN r36583]
2007-01-04 09:22:02 +00:00
Christopher Kohlhoff
2ba4146527 Update socket option classes to match interface in TR2 proposal.
[SVN r36582]
2007-01-04 08:21:33 +00:00
Christopher Kohlhoff
2b4748aaaa Update copyright strings to include 2007.
[SVN r36581]
2007-01-04 05:53:07 +00:00
Christopher Kohlhoff
e4d9ea696a Add io_service::id to identify service classes.
[SVN r36580]
2007-01-04 03:43:37 +00:00
Christopher Kohlhoff
af1cb70843 Fix for Borland C++.
[SVN r36579]
2007-01-04 03:39:38 +00:00
Christopher Kohlhoff
fb8dd74390 Documentation cleanup.
[SVN r36578]
2007-01-04 03:38:18 +00:00
Christopher Kohlhoff
390ffd9f7e Exclude error_base from documentation.
[SVN r36577]
2007-01-04 03:38:02 +00:00
Christopher Kohlhoff
00690b50ed Add documentation.
[SVN r36502]
2006-12-24 08:35:08 +00:00
Christopher Kohlhoff
7a2eac3878 Map ERROR_PORT_UNREACHABLE to WSAECONNREFUSED.
[SVN r36474]
2006-12-21 04:07:27 +00:00
Christopher Kohlhoff
ae1be56a05 Move erase from hash_map to prevent multiple delete.
[SVN r36473]
2006-12-21 04:06:41 +00:00
Christopher Kohlhoff
5cded59aef Replace win_iocp_io_service::register_socket() with register_handle() to
allow it to be used with other Windows kernel objects.


[SVN r36311]
2006-12-09 22:31:44 +00:00
Christopher Kohlhoff
e3f0c76fce Use static placeholders for VC7.x.
[SVN r36169]
2006-11-23 21:59:10 +00:00
Christopher Kohlhoff
99d1078a15 Add equality/inequality operators for protocol classes.
[SVN r36106]
2006-11-20 12:59:49 +00:00
Christopher Kohlhoff
dca74fd492 Include <ostream> instead of <iostream>.
[SVN r36096]
2006-11-19 21:33:43 +00:00
Christopher Kohlhoff
8d8077a267 Add missing inline keyword, needed to fix multiple definition errors.
[SVN r36095]
2006-11-19 21:33:04 +00:00
Christopher Kohlhoff
b0e159fc55 Add a workaround for an apparent Windows bug where the delivery of
asynchronous I/O completions is delayed if the thread used to start the
operation is CPU bound.


[SVN r36069]
2006-11-17 11:40:48 +00:00
Christopher Kohlhoff
8b56b8cf6d Remove the error::success constant since with the new error_code stuff
there is no unique value for success.


[SVN r36068]
2006-11-17 11:28:18 +00:00
Christopher Kohlhoff
0b9d2dc400 Add ability to specify the level of concurrency desired, which is currently
used by Win32's I/O completion ports.


[SVN r36057]
2006-11-16 11:50:57 +00:00
Christopher Kohlhoff
3cc30008b4 Need to clear error after successful call of WSAAddressToString or
WSAStringToAddress.


[SVN r36056]
2006-11-16 11:49:11 +00:00
Christopher Kohlhoff
e504cf5c6c Remove unnecessary invoke hook since the default one provides the correct
behaviour, and including it here for the invoke_current_handler class breaks
MSVC 7.1 when generating browse information.


[SVN r36055]
2006-11-16 11:47:42 +00:00
Christopher Kohlhoff
837470ac11 Don't use named temporary since it confuses g++ 3.3.
[SVN r36039]
2006-11-14 10:50:18 +00:00
Christopher Kohlhoff
2b7016726f Inclusion of boost/cerrno.hpp is needed, so revert previous change.
[SVN r36038]
2006-11-14 10:49:09 +00:00
Christopher Kohlhoff
94979ba49f Remove documentation that is no longer correct.
[SVN r36037]
2006-11-14 10:41:33 +00:00
Christopher Kohlhoff
fb3eaba113 Change to use function-based placeholders for gcc to avoid some duplicate
symbol linker problems.


[SVN r36036]
2006-11-14 10:40:55 +00:00
Christopher Kohlhoff
e128068a1f Remove unnecessary include.
[SVN r36035]
2006-11-14 10:40:05 +00:00
Christopher Kohlhoff
851d074dd6 The openssl_locking_func() callback can be invoked through
OpenSSL_add_ssl_algorithms(), which causes instance() to be called
recursively before the static shared_ptr was initialized.


[SVN r35942]
2006-11-09 03:04:05 +00:00
Christopher Kohlhoff
852668d1da Change error handling to match TR2 proposal.
[SVN r35911]
2006-11-08 05:32:17 +00:00
Christopher Kohlhoff
da2ef49a00 Add max_size() function to basic_streambuf.
Make basic_io_object constructor protected.

Make a 0-length send or receive on a stream socket into a no-op.

Add cancel() function for cancelling asynchronous socket operations.
The Win32 implementation only works if all operations for the socket
have been issued from the same thread, otherwise it fails with
asio::error::not_supported.

Add workaround for an apparent Windows bug where using getpeername on
a socket accepted using AcceptEx will sometimes return an endpoint
that is all zeroes.

Make a strand last as long as it has any handlers to dispatch. Make
strand a nested class of io_service.

Add io_service() function to io_service::work to return a reference to
the io_service object on which the work is being performed. Renamed
io_service::service::owner() to io_service::service::io_service().

Unset linger object when socket objects are destroyed.

Rename asio_handler_dispatch to asio_handler_invoke.

Rename basic_socketbuf to basic_socket_streambuf.

Update ip::address_v4 and ip::address_v6 classes to match TR2
proposal.

Add run_one(), poll() and poll_one() functions to the io_service.

Remove need to #define FD_SETSIZE on Win32.

Add detection of incorrect inclusion of WinSock.h.

Fix some SSL bugs. Add ability to customise the SSL password callback
function.

Set the reuse_address option by default on acceptors.

The macros FIONREAD and FIONBIO are not integer constants on all
platforms, and so cannot be used as template arguments. Make the
corresponding I/O control commands into proper classes, not templates.

Fixes to better support *BSD platforms.

Add support for buffer debugging, if the standard library supports
iterator debugging (as MSVC8's standard lib does).

Ensure the IOCP queue is drained correctly at shutdown.

Move basic_resolver and resolver service into the ip namespace.

Fix some issues found by the inspect tool.


[SVN r35833]
2006-11-04 07:14:10 +00:00
Christopher Kohlhoff
8e4fa8f544 Maintain separate timer queues for each time traits type.
[SVN r34740]
2006-07-26 11:23:25 +00:00
Christopher Kohlhoff
f7e92ba296 Fix compiler warnings with MSVC8.
[SVN r34739]
2006-07-26 11:19:21 +00:00