diff options
author | Remko Tronçon <git@el-tramo.be> | 2012-12-23 13:16:26 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2012-12-23 14:43:26 (GMT) |
commit | 491ddd570a752cf9bda85933bed0c6942e39b1f9 (patch) | |
tree | 10c25c1be8cc08d0497df1dccd56a10fbb30beee /3rdParty/Boost/src/boost/asio/raw_socket_service.hpp | |
parent | da7d7a0ca71b80281aa9ff2526290b61ccb0cc60 (diff) | |
download | swift-contrib-491ddd570a752cf9bda85933bed0c6942e39b1f9.zip swift-contrib-491ddd570a752cf9bda85933bed0c6942e39b1f9.tar.bz2 |
Update Boost to 1.52.0.
Change-Id: I1e56bea2600bf2ed9c5b3aba8c4f9d2a0f350e77
Diffstat (limited to '3rdParty/Boost/src/boost/asio/raw_socket_service.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/asio/raw_socket_service.hpp | 109 |
1 files changed, 87 insertions, 22 deletions
diff --git a/3rdParty/Boost/src/boost/asio/raw_socket_service.hpp b/3rdParty/Boost/src/boost/asio/raw_socket_service.hpp index 783c4c2..cd8aa04 100644 --- a/3rdParty/Boost/src/boost/asio/raw_socket_service.hpp +++ b/3rdParty/Boost/src/boost/asio/raw_socket_service.hpp @@ -2,7 +2,7 @@ // raw_socket_service.hpp // ~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2011 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -68,11 +68,18 @@ public: typedef typename service_impl_type::implementation_type implementation_type; #endif - /// The native socket type. + /// (Deprecated: Use native_handle_type.) The native socket type. #if defined(GENERATING_DOCUMENTATION) typedef implementation_defined native_type; #else - typedef typename service_impl_type::native_type native_type; + typedef typename service_impl_type::native_handle_type native_type; +#endif + + /// The native socket type. +#if defined(GENERATING_DOCUMENTATION) + typedef implementation_defined native_handle_type; +#else + typedef typename service_impl_type::native_handle_type native_handle_type; #endif /// Construct a new raw socket service for the specified io_service. @@ -83,18 +90,29 @@ public: { } - /// Destroy all user-defined handler objects owned by the service. - void shutdown_service() - { - service_impl_.shutdown_service(); - } - /// Construct a new raw socket implementation. void construct(implementation_type& impl) { service_impl_.construct(impl); } +#if defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Move-construct a new raw socket implementation. + void move_construct(implementation_type& impl, + implementation_type& other_impl) + { + service_impl_.move_construct(impl, other_impl); + } + + /// Move-assign from another raw socket implementation. + void move_assign(implementation_type& impl, + raw_socket_service& other_service, + implementation_type& other_impl) + { + service_impl_.move_assign(impl, other_service.service_impl_, other_impl); + } +#endif // defined(BOOST_ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) + /// Destroy a raw socket implementation. void destroy(implementation_type& impl) { @@ -114,7 +132,7 @@ public: /// Assign an existing native socket to a raw socket. boost::system::error_code assign(implementation_type& impl, - const protocol_type& protocol, const native_type& native_socket, + const protocol_type& protocol, const native_handle_type& native_socket, boost::system::error_code& ec) { return service_impl_.assign(impl, protocol, native_socket, ec); @@ -133,10 +151,16 @@ public: return service_impl_.close(impl, ec); } - /// Get the native socket implementation. + /// (Deprecated: Use native_handle().) Get the native socket implementation. native_type native(implementation_type& impl) { - return service_impl_.native(impl); + return service_impl_.native_handle(impl); + } + + /// Get the native socket implementation. + native_handle_type native_handle(implementation_type& impl) + { + return service_impl_.native_handle(impl); } /// Cancel all asynchronous operations associated with the socket. @@ -177,9 +201,11 @@ public: /// Start an asynchronous connect. template <typename ConnectHandler> void async_connect(implementation_type& impl, - const endpoint_type& peer_endpoint, ConnectHandler handler) + const endpoint_type& peer_endpoint, + BOOST_ASIO_MOVE_ARG(ConnectHandler) handler) { - service_impl_.async_connect(impl, peer_endpoint, handler); + service_impl_.async_connect(impl, peer_endpoint, + BOOST_ASIO_MOVE_CAST(ConnectHandler)(handler)); } /// Set a socket option. @@ -206,6 +232,32 @@ public: return service_impl_.io_control(impl, command, ec); } + /// Gets the non-blocking mode of the socket. + bool non_blocking(const implementation_type& impl) const + { + return service_impl_.non_blocking(impl); + } + + /// Sets the non-blocking mode of the socket. + boost::system::error_code non_blocking(implementation_type& impl, + bool mode, boost::system::error_code& ec) + { + return service_impl_.non_blocking(impl, mode, ec); + } + + /// Gets the non-blocking mode of the native socket implementation. + bool native_non_blocking(const implementation_type& impl) const + { + return service_impl_.native_non_blocking(impl); + } + + /// Sets the non-blocking mode of the native socket implementation. + boost::system::error_code native_non_blocking(implementation_type& impl, + bool mode, boost::system::error_code& ec) + { + return service_impl_.native_non_blocking(impl, mode, ec); + } + /// Get the local endpoint. endpoint_type local_endpoint(const implementation_type& impl, boost::system::error_code& ec) const @@ -239,9 +291,11 @@ public: /// Start an asynchronous send. template <typename ConstBufferSequence, typename WriteHandler> void async_send(implementation_type& impl, const ConstBufferSequence& buffers, - socket_base::message_flags flags, WriteHandler handler) + socket_base::message_flags flags, + BOOST_ASIO_MOVE_ARG(WriteHandler) handler) { - service_impl_.async_send(impl, buffers, flags, handler); + service_impl_.async_send(impl, buffers, flags, + BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); } /// Send raw data to the specified endpoint. @@ -257,9 +311,11 @@ public: template <typename ConstBufferSequence, typename WriteHandler> void async_send_to(implementation_type& impl, const ConstBufferSequence& buffers, const endpoint_type& destination, - socket_base::message_flags flags, WriteHandler handler) + socket_base::message_flags flags, + BOOST_ASIO_MOVE_ARG(WriteHandler) handler) { - service_impl_.async_send_to(impl, buffers, destination, flags, handler); + service_impl_.async_send_to(impl, buffers, destination, flags, + BOOST_ASIO_MOVE_CAST(WriteHandler)(handler)); } /// Receive some data from the peer. @@ -275,9 +331,11 @@ public: template <typename MutableBufferSequence, typename ReadHandler> void async_receive(implementation_type& impl, const MutableBufferSequence& buffers, - socket_base::message_flags flags, ReadHandler handler) + socket_base::message_flags flags, + BOOST_ASIO_MOVE_ARG(ReadHandler) handler) { - service_impl_.async_receive(impl, buffers, flags, handler); + service_impl_.async_receive(impl, buffers, flags, + BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } /// Receive raw data with the endpoint of the sender. @@ -294,13 +352,20 @@ public: template <typename MutableBufferSequence, typename ReadHandler> void async_receive_from(implementation_type& impl, const MutableBufferSequence& buffers, endpoint_type& sender_endpoint, - socket_base::message_flags flags, ReadHandler handler) + socket_base::message_flags flags, + BOOST_ASIO_MOVE_ARG(ReadHandler) handler) { service_impl_.async_receive_from(impl, buffers, sender_endpoint, flags, - handler); + BOOST_ASIO_MOVE_CAST(ReadHandler)(handler)); } private: + // Destroy all user-defined handler objects owned by the service. + void shutdown_service() + { + service_impl_.shutdown_service(); + } + // The platform-specific implementation. service_impl_type service_impl_; }; |