Commit Graph

1359 Commits

Author SHA1 Message Date
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
f5c8b33267 Version bump.
[SVN r74864]
2011-10-09 22:02:05 +00:00
Christopher Kohlhoff
77dec8e703 Merge from trunk...
Fix compile error in regex overload of async_read_until.hpp. Fixes #5688

Explicitly specify the signal() function from the global namespace. Fixes #5722

Don't read the clock unless the heap is non-empty.

Change the SSL buffers sizes so that they're large enough to hold a complete TLS record. Fixes #5854

Make sure the synchronous null_buffers operations obey the user's non_blocking setting. Fixes #5756

Set size of select fd_set at runtime when using Windows.

Disable warning due to const qualifier being applied to function type.

Fix crash due to gcc_x86_fenced_block that shows up when using the Intel C++ compiler. Fixes #5763

Specialise operations for buffer sequences that are arrays of exactly two buffers.

Initialise all OpenSSL algorithms.

Fix error mapping when session is gracefully shut down.

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.

Remove unused state in HTTP server examples.

Add latency test programs.


[SVN r74863]
2011-10-09 21:59:57 +00:00
Christopher Kohlhoff
49d9532ab0 Add latency test programs.
[SVN r74827]
2011-10-08 22:12:30 +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
52b61e7e77 Remove unused state.
[SVN r74819]
2011-10-08 21:21:54 +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
18a48222ed Merge fixes from trunk:
* Fix bullet list.

* Fix include guard.

* Zero-length reads and writes need to complete immediately.

* Fix for static mutex initialisation.

Authorized by Beman


[SVN r72847]
2011-07-02 09:18:41 +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
353e71c965 Fix bullet list.
[SVN r72805]
2011-06-29 23:31:37 +00:00
Christopher Kohlhoff
7d6c1c318d Revision history.
[SVN r72433]
2011-06-06 11:57:21 +00:00
Christopher Kohlhoff
70243efb24 Revision history.
[SVN r72432]
2011-06-06 11:56:18 +00:00
Christopher Kohlhoff
b91e7a6f65 Merge asio from trunk.
[SVN r72428]
2011-06-05 23:21:43 +00:00
Christopher Kohlhoff
2a4c82ab84 Add TOC entry for fork.
[SVN r72426]
2011-06-05 21:40:24 +00:00
Christopher Kohlhoff
a166d19a13 Update overview TOC.
[SVN r72408]
2011-06-05 14:35:14 +00:00
Christopher Kohlhoff
2a89061940 Use correct source mode.
[SVN r72407]
2011-06-05 14:34:45 +00:00
Christopher Kohlhoff
e5818e7994 Include the io_service::service class's private member functions in the documentation.
[SVN r72406]
2011-06-05 14:09:04 +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
825d1c90c6 Treat accept failure as a non-fatal error in most examples.
[SVN r72142]
2011-05-24 23:33:55 +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
a2000c8a38 Use new signal_set to shut down.
[SVN r71707]
2011-05-03 23:57:23 +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
0a10f19dbf Merge selected bug fixes from trunk:
* Fixed a compile error on some versions of g++ due to anonymous enums.
  Fixes #4883.

* 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().)

* 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. Fixes #5021.

* 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.  

* Fixed the linger socket option on non-Windows platforms.

* Fixed function name in comment for asio::placeholders::iterator.


[SVN r69680]
2011-03-08 11:07:01 +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