Commit Graph

1359 Commits

Author SHA1 Message Date
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
28ab37a23e Merge from trunk:
* Update copyright notice.

* Version bump.

* Fix out-of-bounds address_v4::broadcast() return value on 64-bit systems.

* Use correct interrupt method when timerfd is not available. Fixes #5045


[SVN r68200]
2011-01-17 04:28:16 +00:00
Christopher Kohlhoff
6ddfb69440 Revision history.
[SVN r68178]
2011-01-16 01:38: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
Steven Watanabe
9bbd81e717 Revert [67111] (addition of boost/detail/iomanip.hpp) and all the commits that depend on it. ([68137], [68140], [68141], [68154], and [68165]).
[SVN r68168]
2011-01-15 08:11:51 +00:00
Bryce Adelstein-Lelbach
c5741b2171 Replacing the use of <iomanip> with <boost/detail/iomanip.hpp> across Boost.
On Linux, GNU's libstdc++, which is the default stdlib for icc and clang,
cannot parse the <iomanip> header in version 4.5+ (which thankfully neither
compiler advises the use of yet), as it's original C++98-friendly
implementation has been replaced with a gnu++0x implementation.
<boost/detail/iomanip.hpp> is a portable implementation of <iomanip>, providing
boost::detail::setfill, boost::detail::setbase, boost::detail::setw,
boost::detail::setprecision, boost::detail::setiosflags and
boost::detail::resetiosflags. 



[SVN r68140]
2011-01-14 02:35:58 +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
009e6a0c02 Merge from trunk.
........
  r66613 | chris_kohlhoff | 2010-11-17 00:16:45 +1100 (Wed, 17 Nov 2010) | 2 lines
  
  Fixed a Windows-specific problem where failures from accept() are incorrectly treated as successes. Refs #4859.
........


[SVN r66620]
2010-11-17 09:51: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
01c7794612 Merged objective c++ fix from tunk. Fixes #4191.
........
  r66289 | chris_kohlhoff | 2010-10-31 09:45:29 +1100 (Sun, 31 Oct 2010) | 4 lines
  
  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.
........
  r66398 | chris_kohlhoff | 2010-11-04 22:40:42 +1100 (Thu, 04 Nov 2010) | 2 lines
  
  MacPorts gcc also defines __APPLE_CC__, but to 1.
........


[SVN r66554]
2010-11-12 23:32:36 +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
1c3548e1c9 Merge updated revision history.
[SVN r66243]
2010-10-28 21:22:10 +00:00
Christopher Kohlhoff
200db06b39 More revision history.
[SVN r66241]
2010-10-28 20:51:01 +00:00
Christopher Kohlhoff
edc26b0006 Merged revision history.
[SVN r66177]
2010-10-25 13:07:38 +00:00
Christopher Kohlhoff
48e36ad46f Revision history.
[SVN r66176]
2010-10-25 13:06:29 +00:00
Christopher Kohlhoff
d7fc4b75fc Merge from trunk: Rename separate compilation header. Fixes #4560.
[SVN r66175]
2010-10-25 12:57:23 +00:00
Christopher Kohlhoff
84ff434f23 Rename separate compilation header. Refs #4560.
[SVN r66174]
2010-10-25 12:26:06 +00:00
Christopher Kohlhoff
727a5c75a3 Merge from trunk.
........
  r66075 | chris_kohlhoff | 2010-10-18 23:27:12 +1100 (Mon, 18 Oct 2010) | 2 lines
  
  Fix unused parameter warnings.
........
  r66143 | chris_kohlhoff | 2010-10-22 23:07:36 +1100 (Fri, 22 Oct 2010) | 2 lines
  
  Redefine Protocol and id to avoid clashing with Objective-C++ keywords. Fixes #4191.
........
  r66144 | chris_kohlhoff | 2010-10-22 23:20:52 +1100 (Fri, 22 Oct 2010) | 2 lines
  
  Version check not required.
........
  r66156 | chris_kohlhoff | 2010-10-24 11:26:10 +1100 (Sun, 24 Oct 2010) | 2 lines
  
  Fix for IBM C++ compiler.
........
  r66158 | chris_kohlhoff | 2010-10-24 13:06:46 +1100 (Sun, 24 Oct 2010) | 2 lines
  
  Fix vector reallocation performance problem. Fixes #4780.
........
  r66159 | chris_kohlhoff | 2010-10-24 18:58:23 +1100 (Sun, 24 Oct 2010) | 2 lines
  
  Fix kqueue_reactor so that it compiles on NetBSD. Fixes #4662.
........
  r66162 | chris_kohlhoff | 2010-10-25 00:15:46 +1100 (Mon, 25 Oct 2010) | 2 lines
  
  Fix failure in socket_base test on NetBSD.
........


[SVN r66173]
2010-10-25 10:44:35 +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
139642203c Fix for IBM C++ compiler.
[SVN r66156]
2010-10-24 00:26:10 +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
81a5e3660d Merge from trunk.
........
  r66022 | chris_kohlhoff | 2010-10-17 00:15:51 +1100 (Sun, 17 Oct 2010) | 2 lines
  
  Pass NULL for servname rather than empty string, as per POSIX. Fixes #4690.
........
  r66056 | chris_kohlhoff | 2010-10-18 08:24:55 +1100 (Mon, 18 Oct 2010) | 2 lines
  
  Fix so that read operations do not accept const_buffers_1 arguments. Fixes #4746.
........


[SVN r66080]
2010-10-18 12:58:10 +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
33e8ad1b8c Merge from trunk.
........
  r65998 | chris_kohlhoff | 2010-10-16 15:30:12 +1100 (Sat, 16 Oct 2010) | 2 lines
  
  Make unit tests build faster.
........
  r66002 | chris_kohlhoff | 2010-10-16 16:13:46 +1100 (Sat, 16 Oct 2010) | 2 lines
  
  Add a test case for bug where a deadline timer never fires if the io_service is run in a background thread. N.B. fails only on platforms that use kqueue. Fixes #4568.
........
  r66004 | chris_kohlhoff | 2010-10-16 16:43:03 +1100 (Sat, 16 Oct 2010) | 2 lines
  
  Fix the way the kqueue_reactor is interrupted when a new timer is scheduled. Fixes #4568.
........
  r66005 | chris_kohlhoff | 2010-10-16 17:27:45 +1100 (Sat, 16 Oct 2010) | 2 lines
  
  Fix a const-correctness issue that prevents valid uses of has_service<> from compiling. Fixes #4638.
........
  r66006 | chris_kohlhoff | 2010-10-16 18:06:18 +1100 (Sat, 16 Oct 2010) | 2 lines
  
  Use lower-case to keep MinGW cross-compilers happy. Fixes #4491.
........
  r66007 | chris_kohlhoff | 2010-10-16 18:24:47 +1100 (Sat, 16 Oct 2010) | 2 lines
  
  Don't use deprecated system functions. Fixes #4672.
........
  r66008 | chris_kohlhoff | 2010-10-16 20:47:11 +1100 (Sat, 16 Oct 2010) | 2 lines
  
  Ensure close()/closesocket() failures are correctly propagated. Fixes #4573.
........
  r66009 | chris_kohlhoff | 2010-10-16 21:01:14 +1100 (Sat, 16 Oct 2010) | 2 lines
  
  Check return code of InitializeCriticalSectionAndSpinCount. Fixes #4574.
........
  r66010 | chris_kohlhoff | 2010-10-16 22:04:08 +1100 (Sat, 16 Oct 2010) | 2 lines
  
  Add support for hardware flow control on QNX. Fixes #4625.
........
  r66014 | chris_kohlhoff | 2010-10-16 22:39:13 +1100 (Sat, 16 Oct 2010) | 2 lines
  
  Always use pselect() on HP-UX, if it is available. Fixes #4578.
........
  r66017 | chris_kohlhoff | 2010-10-16 23:23:56 +1100 (Sat, 16 Oct 2010) | 2 lines
  
  Ensure handler arguments are passed as lvalues. Fixes #4744.
........
  r66018 | chris_kohlhoff | 2010-10-16 23:39:06 +1100 (Sat, 16 Oct 2010) | 2 lines
  
  Fix Windows build when thread support is disabled. Fixes #4680.
........
  r66020 | chris_kohlhoff | 2010-10-16 23:59:29 +1100 (Sat, 16 Oct 2010) | 3 lines
  
  Timers with expiry times set more than 5 minutes in the future need the
  waitable timer to be periodic. Fixes #4745.
........
  r66035 | chris_kohlhoff | 2010-10-17 22:33:28 +1100 (Sun, 17 Oct 2010) | 2 lines
  
  Version bump.
........


[SVN r66037]
2010-10-17 12:24:50 +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
498bbe6f0c Add a test case for bug where a deadline timer never fires if the io_service is run in a background thread. N.B. fails only on platforms that use kqueue. Refs #4568.
[SVN r66002]
2010-10-16 05:13:46 +00:00
Christopher Kohlhoff
986c2b8e9a Make unit tests build faster.
[SVN r65998]
2010-10-16 04:30:12 +00:00
John Maddock
75e780357e Fix image location for PDF builds.
[SVN r64254]
2010-07-22 10:58:39 +00:00
John Maddock
104fe57a22 Fix asio PDF builds - make sure that the images are found correctly and that the file name turns out right.
[SVN r64252]
2010-07-22 10:55:27 +00:00
Christopher Kohlhoff
f7e69ef4ae Revision history.
[SVN r64221]
2010-07-21 13:38:39 +00:00