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().
This commit is contained in:
parent
7afff4618f
commit
f916c5d43b
@ -42,8 +42,12 @@ class basic_datagram_socket
|
||||
: public basic_socket<Protocol, DatagramSocketService>
|
||||
{
|
||||
public:
|
||||
/// (Deprecated: Use native_handle_type.) The native representation of a
|
||||
/// socket.
|
||||
typedef typename DatagramSocketService::native_handle_type native_type;
|
||||
|
||||
/// The native representation of a socket.
|
||||
typedef typename DatagramSocketService::native_type native_type;
|
||||
typedef typename DatagramSocketService::native_handle_type native_handle_type;
|
||||
|
||||
/// The protocol type.
|
||||
typedef Protocol protocol_type;
|
||||
@ -121,7 +125,7 @@ public:
|
||||
* @throws asio::system_error Thrown on failure.
|
||||
*/
|
||||
basic_datagram_socket(asio::io_service& io_service,
|
||||
const protocol_type& protocol, const native_type& native_socket)
|
||||
const protocol_type& protocol, const native_handle_type& native_socket)
|
||||
: basic_socket<Protocol, DatagramSocketService>(
|
||||
io_service, protocol, native_socket)
|
||||
{
|
||||
|
@ -42,8 +42,12 @@ class basic_raw_socket
|
||||
: public basic_socket<Protocol, RawSocketService>
|
||||
{
|
||||
public:
|
||||
/// (Deprecated: Use native_handle_type.) The native representation of a
|
||||
/// socket.
|
||||
typedef typename RawSocketService::native_handle_type native_type;
|
||||
|
||||
/// The native representation of a socket.
|
||||
typedef typename RawSocketService::native_type native_type;
|
||||
typedef typename RawSocketService::native_handle_type native_handle_type;
|
||||
|
||||
/// The protocol type.
|
||||
typedef Protocol protocol_type;
|
||||
@ -121,7 +125,7 @@ public:
|
||||
* @throws asio::system_error Thrown on failure.
|
||||
*/
|
||||
basic_raw_socket(asio::io_service& io_service,
|
||||
const protocol_type& protocol, const native_type& native_socket)
|
||||
const protocol_type& protocol, const native_handle_type& native_socket)
|
||||
: basic_socket<Protocol, RawSocketService>(
|
||||
io_service, protocol, native_socket)
|
||||
{
|
||||
|
@ -48,8 +48,12 @@ class basic_serial_port
|
||||
public serial_port_base
|
||||
{
|
||||
public:
|
||||
/// (Deprecated: Use native_handle_type.) The native representation of a
|
||||
/// serial port.
|
||||
typedef typename SerialPortService::native_handle_type native_type;
|
||||
|
||||
/// The native representation of a serial port.
|
||||
typedef typename SerialPortService::native_type native_type;
|
||||
typedef typename SerialPortService::native_handle_type native_handle_type;
|
||||
|
||||
/// A basic_serial_port is always the lowest layer.
|
||||
typedef basic_serial_port<SerialPortService> lowest_layer_type;
|
||||
@ -119,7 +123,7 @@ public:
|
||||
* @throws asio::system_error Thrown on failure.
|
||||
*/
|
||||
basic_serial_port(asio::io_service& io_service,
|
||||
const native_type& native_serial_port)
|
||||
const native_handle_type& native_serial_port)
|
||||
: basic_io_object<SerialPortService>(io_service)
|
||||
{
|
||||
asio::error_code ec;
|
||||
@ -193,7 +197,7 @@ public:
|
||||
*
|
||||
* @throws asio::system_error Thrown on failure.
|
||||
*/
|
||||
void assign(const native_type& native_serial_port)
|
||||
void assign(const native_handle_type& native_serial_port)
|
||||
{
|
||||
asio::error_code ec;
|
||||
this->service.assign(this->implementation, native_serial_port, ec);
|
||||
@ -208,7 +212,7 @@ public:
|
||||
*
|
||||
* @param ec Set to indicate what error occurred, if any.
|
||||
*/
|
||||
asio::error_code assign(const native_type& native_serial_port,
|
||||
asio::error_code assign(const native_handle_type& native_serial_port,
|
||||
asio::error_code& ec)
|
||||
{
|
||||
return this->service.assign(this->implementation, native_serial_port, ec);
|
||||
@ -248,7 +252,8 @@ public:
|
||||
return this->service.close(this->implementation, ec);
|
||||
}
|
||||
|
||||
/// Get the native serial port representation.
|
||||
/// (Deprecated: Use native_handle().) Get the native serial port
|
||||
/// representation.
|
||||
/**
|
||||
* This function may be used to obtain the underlying representation of the
|
||||
* serial port. This is intended to allow access to native serial port
|
||||
@ -256,7 +261,18 @@ public:
|
||||
*/
|
||||
native_type native()
|
||||
{
|
||||
return this->service.native(this->implementation);
|
||||
return this->service.native_handle(this->implementation);
|
||||
}
|
||||
|
||||
/// Get the native serial port representation.
|
||||
/**
|
||||
* This function may be used to obtain the underlying representation of the
|
||||
* serial port. This is intended to allow access to native serial port
|
||||
* functionality that is not otherwise provided.
|
||||
*/
|
||||
native_handle_type native_handle()
|
||||
{
|
||||
return this->service.native_handle(this->implementation);
|
||||
}
|
||||
|
||||
/// Cancel all asynchronous operations associated with the serial port.
|
||||
|
@ -41,8 +41,12 @@ class basic_socket
|
||||
public socket_base
|
||||
{
|
||||
public:
|
||||
/// (Deprecated: Use native_handle_type.) The native representation of a
|
||||
/// socket.
|
||||
typedef typename SocketService::native_handle_type native_type;
|
||||
|
||||
/// The native representation of a socket.
|
||||
typedef typename SocketService::native_type native_type;
|
||||
typedef typename SocketService::native_handle_type native_handle_type;
|
||||
|
||||
/// The protocol type.
|
||||
typedef Protocol protocol_type;
|
||||
@ -125,7 +129,7 @@ public:
|
||||
* @throws asio::system_error Thrown on failure.
|
||||
*/
|
||||
basic_socket(asio::io_service& io_service,
|
||||
const protocol_type& protocol, const native_type& native_socket)
|
||||
const protocol_type& protocol, const native_handle_type& native_socket)
|
||||
: basic_io_object<SocketService>(io_service)
|
||||
{
|
||||
asio::error_code ec;
|
||||
@ -217,7 +221,8 @@ public:
|
||||
*
|
||||
* @throws asio::system_error Thrown on failure.
|
||||
*/
|
||||
void assign(const protocol_type& protocol, const native_type& native_socket)
|
||||
void assign(const protocol_type& protocol,
|
||||
const native_handle_type& native_socket)
|
||||
{
|
||||
asio::error_code ec;
|
||||
this->service.assign(this->implementation, protocol, native_socket, ec);
|
||||
@ -235,7 +240,7 @@ public:
|
||||
* @param ec Set to indicate what error occurred, if any.
|
||||
*/
|
||||
asio::error_code assign(const protocol_type& protocol,
|
||||
const native_type& native_socket, asio::error_code& ec)
|
||||
const native_handle_type& native_socket, asio::error_code& ec)
|
||||
{
|
||||
return this->service.assign(this->implementation,
|
||||
protocol, native_socket, ec);
|
||||
@ -293,7 +298,7 @@ public:
|
||||
return this->service.close(this->implementation, ec);
|
||||
}
|
||||
|
||||
/// Get the native socket representation.
|
||||
/// (Deprecated: Use native_handle().) Get the native socket representation.
|
||||
/**
|
||||
* This function may be used to obtain the underlying representation of the
|
||||
* socket. This is intended to allow access to native socket functionality
|
||||
@ -301,7 +306,18 @@ public:
|
||||
*/
|
||||
native_type native()
|
||||
{
|
||||
return this->service.native(this->implementation);
|
||||
return this->service.native_handle(this->implementation);
|
||||
}
|
||||
|
||||
/// Get the native socket representation.
|
||||
/**
|
||||
* This function may be used to obtain the underlying representation of the
|
||||
* socket. This is intended to allow access to native socket functionality
|
||||
* that is not otherwise provided.
|
||||
*/
|
||||
native_handle_type native_handle()
|
||||
{
|
||||
return this->service.native_handle(this->implementation);
|
||||
}
|
||||
|
||||
/// Cancel all asynchronous operations associated with the socket.
|
||||
|
@ -55,8 +55,12 @@ class basic_socket_acceptor
|
||||
public socket_base
|
||||
{
|
||||
public:
|
||||
/// (Deprecated: Use native_handle_type.) The native representation of an
|
||||
/// acceptor.
|
||||
typedef typename SocketAcceptorService::native_handle_type native_type;
|
||||
|
||||
/// The native representation of an acceptor.
|
||||
typedef typename SocketAcceptorService::native_type native_type;
|
||||
typedef typename SocketAcceptorService::native_handle_type native_handle_type;
|
||||
|
||||
/// The protocol type.
|
||||
typedef Protocol protocol_type;
|
||||
@ -163,7 +167,7 @@ public:
|
||||
* @throws asio::system_error Thrown on failure.
|
||||
*/
|
||||
basic_socket_acceptor(asio::io_service& io_service,
|
||||
const protocol_type& protocol, const native_type& native_acceptor)
|
||||
const protocol_type& protocol, const native_handle_type& native_acceptor)
|
||||
: basic_io_object<SocketAcceptorService>(io_service)
|
||||
{
|
||||
asio::error_code ec;
|
||||
@ -229,7 +233,8 @@ public:
|
||||
*
|
||||
* @throws asio::system_error Thrown on failure.
|
||||
*/
|
||||
void assign(const protocol_type& protocol, const native_type& native_acceptor)
|
||||
void assign(const protocol_type& protocol,
|
||||
const native_handle_type& native_acceptor)
|
||||
{
|
||||
asio::error_code ec;
|
||||
this->service.assign(this->implementation, protocol, native_acceptor, ec);
|
||||
@ -247,7 +252,7 @@ public:
|
||||
* @param ec Set to indicate what error occurred, if any.
|
||||
*/
|
||||
asio::error_code assign(const protocol_type& protocol,
|
||||
const native_type& native_acceptor, asio::error_code& ec)
|
||||
const native_handle_type& native_acceptor, asio::error_code& ec)
|
||||
{
|
||||
return this->service.assign(this->implementation,
|
||||
protocol, native_acceptor, ec);
|
||||
@ -399,7 +404,7 @@ public:
|
||||
return this->service.close(this->implementation, ec);
|
||||
}
|
||||
|
||||
/// Get the native acceptor representation.
|
||||
/// (Deprecated: Use native_handle().) Get the native acceptor representation.
|
||||
/**
|
||||
* This function may be used to obtain the underlying representation of the
|
||||
* acceptor. This is intended to allow access to native acceptor functionality
|
||||
@ -407,7 +412,18 @@ public:
|
||||
*/
|
||||
native_type native()
|
||||
{
|
||||
return this->service.native(this->implementation);
|
||||
return this->service.native_handle(this->implementation);
|
||||
}
|
||||
|
||||
/// Get the native acceptor representation.
|
||||
/**
|
||||
* This function may be used to obtain the underlying representation of the
|
||||
* acceptor. This is intended to allow access to native acceptor functionality
|
||||
* that is not otherwise provided.
|
||||
*/
|
||||
native_handle_type native_handle()
|
||||
{
|
||||
return this->service.native_handle(this->implementation);
|
||||
}
|
||||
|
||||
/// Cancel all asynchronous operations associated with the acceptor.
|
||||
|
@ -45,8 +45,12 @@ class basic_stream_socket
|
||||
: public basic_socket<Protocol, StreamSocketService>
|
||||
{
|
||||
public:
|
||||
/// (Deprecated: Use native_handle_type.) The native representation of a
|
||||
/// socket.
|
||||
typedef typename StreamSocketService::native_handle_type native_type;
|
||||
|
||||
/// The native representation of a socket.
|
||||
typedef typename StreamSocketService::native_type native_type;
|
||||
typedef typename StreamSocketService::native_handle_type native_handle_type;
|
||||
|
||||
/// The protocol type.
|
||||
typedef Protocol protocol_type;
|
||||
@ -122,7 +126,7 @@ public:
|
||||
* @throws asio::system_error Thrown on failure.
|
||||
*/
|
||||
basic_stream_socket(asio::io_service& io_service,
|
||||
const protocol_type& protocol, const native_type& native_socket)
|
||||
const protocol_type& protocol, const native_handle_type& native_socket)
|
||||
: basic_socket<Protocol, StreamSocketService>(
|
||||
io_service, protocol, native_socket)
|
||||
{
|
||||
|
@ -67,11 +67,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 datagram socket service for the specified io_service.
|
||||
@ -113,7 +120,7 @@ public:
|
||||
|
||||
/// Assign an existing native socket to a datagram socket.
|
||||
asio::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,
|
||||
asio::error_code& ec)
|
||||
{
|
||||
return service_impl_.assign(impl, protocol, native_socket, ec);
|
||||
@ -132,10 +139,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.
|
||||
|
@ -57,7 +57,7 @@ void reactive_descriptor_service::destroy(
|
||||
|
||||
asio::error_code reactive_descriptor_service::assign(
|
||||
reactive_descriptor_service::implementation_type& impl,
|
||||
const native_type& native_descriptor, asio::error_code& ec)
|
||||
const native_handle_type& native_descriptor, asio::error_code& ec)
|
||||
{
|
||||
if (is_open(impl))
|
||||
{
|
||||
|
@ -112,7 +112,7 @@ asio::error_code reactive_serial_port_service::do_set_option(
|
||||
termios ios;
|
||||
errno = 0;
|
||||
descriptor_ops::error_wrapper(::tcgetattr(
|
||||
descriptor_service_.native(impl), &ios), ec);
|
||||
descriptor_service_.native_handle(impl), &ios), ec);
|
||||
if (ec)
|
||||
return ec;
|
||||
|
||||
@ -121,7 +121,7 @@ asio::error_code reactive_serial_port_service::do_set_option(
|
||||
|
||||
errno = 0;
|
||||
descriptor_ops::error_wrapper(::tcsetattr(
|
||||
descriptor_service_.native(impl), TCSANOW, &ios), ec);
|
||||
descriptor_service_.native_handle(impl), TCSANOW, &ios), ec);
|
||||
return ec;
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ asio::error_code reactive_serial_port_service::do_get_option(
|
||||
termios ios;
|
||||
errno = 0;
|
||||
descriptor_ops::error_wrapper(::tcgetattr(
|
||||
descriptor_service_.native(impl), &ios), ec);
|
||||
descriptor_service_.native_handle(impl), &ios), ec);
|
||||
if (ec)
|
||||
return ec;
|
||||
|
||||
|
@ -118,7 +118,7 @@ asio::error_code reactive_socket_service_base::do_open(
|
||||
|
||||
asio::error_code reactive_socket_service_base::do_assign(
|
||||
reactive_socket_service_base::base_implementation_type& impl, int type,
|
||||
const reactive_socket_service_base::native_type& native_socket,
|
||||
const reactive_socket_service_base::native_handle_type& native_socket,
|
||||
asio::error_code& ec)
|
||||
{
|
||||
if (is_open(impl))
|
||||
|
@ -118,7 +118,7 @@ void win_iocp_handle_service::destroy(
|
||||
|
||||
asio::error_code win_iocp_handle_service::assign(
|
||||
win_iocp_handle_service::implementation_type& impl,
|
||||
const native_type& native_handle, asio::error_code& ec)
|
||||
const native_handle_type& handle, asio::error_code& ec)
|
||||
{
|
||||
if (is_open(impl))
|
||||
{
|
||||
@ -126,10 +126,10 @@ asio::error_code win_iocp_handle_service::assign(
|
||||
return ec;
|
||||
}
|
||||
|
||||
if (iocp_service_.register_handle(native_handle, ec))
|
||||
if (iocp_service_.register_handle(handle, ec))
|
||||
return ec;
|
||||
|
||||
impl.handle_ = native_handle;
|
||||
impl.handle_ = handle;
|
||||
ec = asio::error_code();
|
||||
return ec;
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ asio::error_code win_iocp_serial_port_service::do_set_option(
|
||||
::DCB dcb;
|
||||
memset(&dcb, 0, sizeof(DCB));
|
||||
dcb.DCBlength = sizeof(DCB);
|
||||
if (!::GetCommState(handle_service_.native(impl), &dcb))
|
||||
if (!::GetCommState(handle_service_.native_handle(impl), &dcb))
|
||||
{
|
||||
DWORD last_error = ::GetLastError();
|
||||
ec = asio::error_code(last_error,
|
||||
@ -137,7 +137,7 @@ asio::error_code win_iocp_serial_port_service::do_set_option(
|
||||
if (store(option, dcb, ec))
|
||||
return ec;
|
||||
|
||||
if (!::SetCommState(handle_service_.native(impl), &dcb))
|
||||
if (!::SetCommState(handle_service_.native_handle(impl), &dcb))
|
||||
{
|
||||
DWORD last_error = ::GetLastError();
|
||||
ec = asio::error_code(last_error,
|
||||
@ -159,7 +159,7 @@ asio::error_code win_iocp_serial_port_service::do_get_option(
|
||||
::DCB dcb;
|
||||
memset(&dcb, 0, sizeof(DCB));
|
||||
dcb.DCBlength = sizeof(DCB);
|
||||
if (!::GetCommState(handle_service_.native(impl), &dcb))
|
||||
if (!::GetCommState(handle_service_.native_handle(impl), &dcb))
|
||||
{
|
||||
DWORD last_error = ::GetLastError();
|
||||
ec = asio::error_code(last_error,
|
||||
|
@ -41,7 +41,7 @@ class reactive_descriptor_service
|
||||
{
|
||||
public:
|
||||
// The native type of a descriptor.
|
||||
typedef int native_type;
|
||||
typedef int native_handle_type;
|
||||
|
||||
// The implementation type of the descriptor.
|
||||
class implementation_type
|
||||
@ -84,7 +84,8 @@ public:
|
||||
|
||||
// Assign a native descriptor to a descriptor implementation.
|
||||
ASIO_DECL asio::error_code assign(implementation_type& impl,
|
||||
const native_type& native_descriptor, asio::error_code& ec);
|
||||
const native_handle_type& native_descriptor,
|
||||
asio::error_code& ec);
|
||||
|
||||
// Determine whether the descriptor is open.
|
||||
bool is_open(const implementation_type& impl) const
|
||||
@ -97,7 +98,7 @@ public:
|
||||
asio::error_code& ec);
|
||||
|
||||
// Get the native descriptor representation.
|
||||
native_type native(const implementation_type& impl) const
|
||||
native_handle_type native_handle(const implementation_type& impl) const
|
||||
{
|
||||
return impl.descriptor_;
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ class reactive_serial_port_service
|
||||
{
|
||||
public:
|
||||
// The native type of a serial port.
|
||||
typedef reactive_descriptor_service::native_type native_type;
|
||||
typedef reactive_descriptor_service::native_handle_type native_handle_type;
|
||||
|
||||
// The implementation type of the serial port.
|
||||
typedef reactive_descriptor_service::implementation_type implementation_type;
|
||||
@ -67,7 +67,8 @@ public:
|
||||
|
||||
// Assign a native descriptor to a serial port implementation.
|
||||
asio::error_code assign(implementation_type& impl,
|
||||
const native_type& native_descriptor, asio::error_code& ec)
|
||||
const native_handle_type& native_descriptor,
|
||||
asio::error_code& ec)
|
||||
{
|
||||
return descriptor_service_.assign(impl, native_descriptor, ec);
|
||||
}
|
||||
@ -86,9 +87,9 @@ public:
|
||||
}
|
||||
|
||||
// Get the native serial port representation.
|
||||
native_type native(implementation_type& impl)
|
||||
native_handle_type native_handle(implementation_type& impl)
|
||||
{
|
||||
return descriptor_service_.native(impl);
|
||||
return descriptor_service_.native_handle(impl);
|
||||
}
|
||||
|
||||
// Cancel all operations associated with the serial port.
|
||||
@ -124,7 +125,7 @@ public:
|
||||
{
|
||||
errno = 0;
|
||||
descriptor_ops::error_wrapper(::tcsendbreak(
|
||||
descriptor_service_.native(impl), 0), ec);
|
||||
descriptor_service_.native_handle(impl), 0), ec);
|
||||
return ec;
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ public:
|
||||
typedef typename Protocol::endpoint endpoint_type;
|
||||
|
||||
// The native type of a socket.
|
||||
typedef socket_type native_type;
|
||||
typedef socket_type native_handle_type;
|
||||
|
||||
// The implementation type of the socket.
|
||||
struct implementation_type :
|
||||
@ -89,7 +89,7 @@ public:
|
||||
|
||||
// Assign a native socket to a socket implementation.
|
||||
asio::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,
|
||||
asio::error_code& ec)
|
||||
{
|
||||
if (!do_assign(impl, protocol.type(), native_socket, ec))
|
||||
@ -98,7 +98,7 @@ public:
|
||||
}
|
||||
|
||||
// Get the native socket representation.
|
||||
native_type native(implementation_type& impl)
|
||||
native_handle_type native_handle(implementation_type& impl)
|
||||
{
|
||||
return impl.socket_;
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ class reactive_socket_service_base
|
||||
{
|
||||
public:
|
||||
// The native type of a socket.
|
||||
typedef socket_type native_type;
|
||||
typedef socket_type native_handle_type;
|
||||
|
||||
// The implementation type of the socket.
|
||||
struct base_implementation_type
|
||||
@ -82,7 +82,7 @@ public:
|
||||
base_implementation_type& impl, asio::error_code& ec);
|
||||
|
||||
// Get the native socket representation.
|
||||
native_type native(base_implementation_type& impl)
|
||||
native_handle_type native_handle(base_implementation_type& impl)
|
||||
{
|
||||
return impl.socket_;
|
||||
}
|
||||
@ -123,7 +123,7 @@ public:
|
||||
return ec;
|
||||
}
|
||||
|
||||
/// Disable sends or receives on the socket.
|
||||
// Disable sends or receives on the socket.
|
||||
asio::error_code shutdown(base_implementation_type& impl,
|
||||
socket_base::shutdown_type what, asio::error_code& ec)
|
||||
{
|
||||
@ -266,7 +266,7 @@ protected:
|
||||
// Assign a native socket to a socket implementation.
|
||||
ASIO_DECL asio::error_code do_assign(
|
||||
base_implementation_type& impl, int type,
|
||||
const native_type& native_socket, asio::error_code& ec);
|
||||
const native_handle_type& native_socket, asio::error_code& ec);
|
||||
|
||||
// Start the asynchronous read or write operation.
|
||||
ASIO_DECL void start_op(base_implementation_type& impl, int op_type,
|
||||
|
@ -40,7 +40,7 @@ class win_iocp_handle_service
|
||||
{
|
||||
public:
|
||||
// The native type of a stream handle.
|
||||
typedef HANDLE native_type;
|
||||
typedef HANDLE native_handle_type;
|
||||
|
||||
// The implementation type of the stream handle.
|
||||
class implementation_type
|
||||
@ -60,7 +60,7 @@ public:
|
||||
friend class win_iocp_handle_service;
|
||||
|
||||
// The native stream handle representation.
|
||||
native_type handle_;
|
||||
native_handle_type handle_;
|
||||
|
||||
// The ID of the thread from which it is safe to cancel asynchronous
|
||||
// operations. 0 means no asynchronous operations have been started yet.
|
||||
@ -86,7 +86,7 @@ public:
|
||||
|
||||
// Assign a native handle to a handle implementation.
|
||||
ASIO_DECL asio::error_code assign(implementation_type& impl,
|
||||
const native_type& native_handle, asio::error_code& ec);
|
||||
const native_handle_type& handle, asio::error_code& ec);
|
||||
|
||||
// Determine whether the handle is open.
|
||||
bool is_open(const implementation_type& impl) const
|
||||
@ -99,7 +99,7 @@ public:
|
||||
asio::error_code& ec);
|
||||
|
||||
// Get the native handle representation.
|
||||
native_type native(const implementation_type& impl) const
|
||||
native_handle_type native_handle(const implementation_type& impl) const
|
||||
{
|
||||
return impl.handle_;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ class win_iocp_serial_port_service
|
||||
{
|
||||
public:
|
||||
// The native type of a serial port.
|
||||
typedef win_iocp_handle_service::native_type native_type;
|
||||
typedef win_iocp_handle_service::native_handle_type native_handle_type;
|
||||
|
||||
// The implementation type of the serial port.
|
||||
typedef win_iocp_handle_service::implementation_type implementation_type;
|
||||
@ -65,9 +65,9 @@ public:
|
||||
|
||||
// Assign a native handle to a serial port implementation.
|
||||
asio::error_code assign(implementation_type& impl,
|
||||
const native_type& native_handle, asio::error_code& ec)
|
||||
const native_handle_type& handle, asio::error_code& ec)
|
||||
{
|
||||
return handle_service_.assign(impl, native_handle, ec);
|
||||
return handle_service_.assign(impl, handle, ec);
|
||||
}
|
||||
|
||||
// Determine whether the serial port is open.
|
||||
@ -84,9 +84,9 @@ public:
|
||||
}
|
||||
|
||||
// Get the native serial port representation.
|
||||
native_type native(implementation_type& impl)
|
||||
native_handle_type native_handle(implementation_type& impl)
|
||||
{
|
||||
return handle_service_.native(impl);
|
||||
return handle_service_.native_handle(impl);
|
||||
}
|
||||
|
||||
// Cancel all operations associated with the handle.
|
||||
|
@ -106,7 +106,7 @@ public:
|
||||
if (!ec)
|
||||
{
|
||||
o->peer_.assign(o->protocol_,
|
||||
typename Socket::native_type(
|
||||
typename Socket::native_handle_type(
|
||||
o->new_socket_.get(), peer_endpoint), ec);
|
||||
if (!ec)
|
||||
o->new_socket_.release();
|
||||
|
@ -60,16 +60,16 @@ public:
|
||||
typedef typename Protocol::endpoint endpoint_type;
|
||||
|
||||
// The native type of a socket.
|
||||
class native_type
|
||||
class native_handle_type
|
||||
{
|
||||
public:
|
||||
native_type(socket_type s)
|
||||
native_handle_type(socket_type s)
|
||||
: socket_(s),
|
||||
have_remote_endpoint_(false)
|
||||
{
|
||||
}
|
||||
|
||||
native_type(socket_type s, const endpoint_type& ep)
|
||||
native_handle_type(socket_type s, const endpoint_type& ep)
|
||||
: socket_(s),
|
||||
have_remote_endpoint_(true),
|
||||
remote_endpoint_(ep)
|
||||
@ -148,7 +148,7 @@ public:
|
||||
|
||||
// Assign a native socket to a socket implementation.
|
||||
asio::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,
|
||||
asio::error_code& ec)
|
||||
{
|
||||
if (!do_assign(impl, protocol.type(), native_socket, ec))
|
||||
@ -161,11 +161,11 @@ public:
|
||||
}
|
||||
|
||||
// Get the native socket representation.
|
||||
native_type native(implementation_type& impl)
|
||||
native_handle_type native_handle(implementation_type& impl)
|
||||
{
|
||||
if (impl.have_remote_endpoint_)
|
||||
return native_type(impl.socket_, impl.remote_endpoint_);
|
||||
return native_type(impl.socket_);
|
||||
return native_handle_type(impl.socket_, impl.remote_endpoint_);
|
||||
return native_handle_type(impl.socket_);
|
||||
}
|
||||
|
||||
// Bind the socket to the specified local endpoint.
|
||||
|
@ -45,8 +45,12 @@ class basic_descriptor
|
||||
public descriptor_base
|
||||
{
|
||||
public:
|
||||
/// (Deprecated: Use native_handle_type.) The native representation of a
|
||||
/// descriptor.
|
||||
typedef typename DescriptorService::native_handle_type native_type;
|
||||
|
||||
/// The native representation of a descriptor.
|
||||
typedef typename DescriptorService::native_type native_type;
|
||||
typedef typename DescriptorService::native_handle_type native_handle_type;
|
||||
|
||||
/// A basic_descriptor is always the lowest layer.
|
||||
typedef basic_descriptor<DescriptorService> lowest_layer_type;
|
||||
@ -78,7 +82,7 @@ public:
|
||||
* @throws asio::system_error Thrown on failure.
|
||||
*/
|
||||
basic_descriptor(asio::io_service& io_service,
|
||||
const native_type& native_descriptor)
|
||||
const native_handle_type& native_descriptor)
|
||||
: basic_io_object<DescriptorService>(io_service)
|
||||
{
|
||||
asio::error_code ec;
|
||||
@ -122,7 +126,7 @@ public:
|
||||
*
|
||||
* @throws asio::system_error Thrown on failure.
|
||||
*/
|
||||
void assign(const native_type& native_descriptor)
|
||||
void assign(const native_handle_type& native_descriptor)
|
||||
{
|
||||
asio::error_code ec;
|
||||
this->service.assign(this->implementation, native_descriptor, ec);
|
||||
@ -137,7 +141,7 @@ public:
|
||||
*
|
||||
* @param ec Set to indicate what error occurred, if any.
|
||||
*/
|
||||
asio::error_code assign(const native_type& native_descriptor,
|
||||
asio::error_code assign(const native_handle_type& native_descriptor,
|
||||
asio::error_code& ec)
|
||||
{
|
||||
return this->service.assign(this->implementation, native_descriptor, ec);
|
||||
@ -177,7 +181,8 @@ public:
|
||||
return this->service.close(this->implementation, ec);
|
||||
}
|
||||
|
||||
/// Get the native descriptor representation.
|
||||
/// (Deprecated: Use native_handle().) Get the native descriptor
|
||||
/// representation.
|
||||
/**
|
||||
* This function may be used to obtain the underlying representation of the
|
||||
* descriptor. This is intended to allow access to native descriptor
|
||||
@ -185,7 +190,18 @@ public:
|
||||
*/
|
||||
native_type native()
|
||||
{
|
||||
return this->service.native(this->implementation);
|
||||
return this->service.native_handle(this->implementation);
|
||||
}
|
||||
|
||||
/// Get the native descriptor representation.
|
||||
/**
|
||||
* This function may be used to obtain the underlying representation of the
|
||||
* descriptor. This is intended to allow access to native descriptor
|
||||
* functionality that is not otherwise provided.
|
||||
*/
|
||||
native_handle_type native_handle()
|
||||
{
|
||||
return this->service.native_handle(this->implementation);
|
||||
}
|
||||
|
||||
/// Cancel all asynchronous operations associated with the descriptor.
|
||||
|
@ -49,8 +49,13 @@ class basic_stream_descriptor
|
||||
: public basic_descriptor<StreamDescriptorService>
|
||||
{
|
||||
public:
|
||||
/// (Deprecated: Use native_handle_type.) The native representation of a
|
||||
/// descriptor.
|
||||
typedef typename StreamDescriptorService::native_handle_type native_type;
|
||||
|
||||
/// The native representation of a descriptor.
|
||||
typedef typename StreamDescriptorService::native_type native_type;
|
||||
typedef typename StreamDescriptorService::native_handle_type
|
||||
native_handle_type;
|
||||
|
||||
/// Construct a basic_stream_descriptor without opening it.
|
||||
/**
|
||||
@ -81,7 +86,7 @@ public:
|
||||
* @throws asio::system_error Thrown on failure.
|
||||
*/
|
||||
basic_stream_descriptor(asio::io_service& io_service,
|
||||
const native_type& native_descriptor)
|
||||
const native_handle_type& native_descriptor)
|
||||
: basic_descriptor<StreamDescriptorService>(io_service, native_descriptor)
|
||||
{
|
||||
}
|
||||
|
@ -56,11 +56,18 @@ public:
|
||||
typedef service_impl_type::implementation_type implementation_type;
|
||||
#endif
|
||||
|
||||
/// The native descriptor type.
|
||||
/// (Deprecated: Use native_handle_type.) The native descriptor type.
|
||||
#if defined(GENERATING_DOCUMENTATION)
|
||||
typedef implementation_defined native_type;
|
||||
#else
|
||||
typedef service_impl_type::native_type native_type;
|
||||
typedef service_impl_type::native_handle_type native_type;
|
||||
#endif
|
||||
|
||||
/// The native descriptor type.
|
||||
#if defined(GENERATING_DOCUMENTATION)
|
||||
typedef implementation_defined native_handle_type;
|
||||
#else
|
||||
typedef service_impl_type::native_handle_type native_handle_type;
|
||||
#endif
|
||||
|
||||
/// Construct a new stream descriptor service for the specified io_service.
|
||||
@ -90,7 +97,8 @@ public:
|
||||
|
||||
/// Assign an existing native descriptor to a stream descriptor.
|
||||
asio::error_code assign(implementation_type& impl,
|
||||
const native_type& native_descriptor, asio::error_code& ec)
|
||||
const native_handle_type& native_descriptor,
|
||||
asio::error_code& ec)
|
||||
{
|
||||
return service_impl_.assign(impl, native_descriptor, ec);
|
||||
}
|
||||
@ -108,10 +116,17 @@ public:
|
||||
return service_impl_.close(impl, ec);
|
||||
}
|
||||
|
||||
/// Get the native descriptor implementation.
|
||||
/// (Deprecated: Use native_handle().) Get the native descriptor
|
||||
/// implementation.
|
||||
native_type native(implementation_type& impl)
|
||||
{
|
||||
return service_impl_.native(impl);
|
||||
return service_impl_.native_handle(impl);
|
||||
}
|
||||
|
||||
/// Get the native descriptor implementation.
|
||||
native_handle_type native_handle(implementation_type& impl)
|
||||
{
|
||||
return service_impl_.native_handle(impl);
|
||||
}
|
||||
|
||||
/// Cancel all asynchronous operations associated with the descriptor.
|
||||
|
@ -67,11 +67,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.
|
||||
@ -113,7 +120,7 @@ public:
|
||||
|
||||
/// Assign an existing native socket to a raw socket.
|
||||
asio::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,
|
||||
asio::error_code& ec)
|
||||
{
|
||||
return service_impl_.assign(impl, protocol, native_socket, ec);
|
||||
@ -132,10 +139,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.
|
||||
|
@ -62,11 +62,18 @@ public:
|
||||
typedef service_impl_type::implementation_type implementation_type;
|
||||
#endif
|
||||
|
||||
/// The native handle type.
|
||||
/// (Deprecated: Use native_handle_type.) The native handle type.
|
||||
#if defined(GENERATING_DOCUMENTATION)
|
||||
typedef implementation_defined native_type;
|
||||
#else
|
||||
typedef service_impl_type::native_type native_type;
|
||||
typedef service_impl_type::native_handle_type native_type;
|
||||
#endif
|
||||
|
||||
/// The native handle type.
|
||||
#if defined(GENERATING_DOCUMENTATION)
|
||||
typedef implementation_defined native_handle_type;
|
||||
#else
|
||||
typedef service_impl_type::native_handle_type native_handle_type;
|
||||
#endif
|
||||
|
||||
/// Construct a new serial port service for the specified io_service.
|
||||
@ -103,9 +110,9 @@ public:
|
||||
|
||||
/// Assign an existing native handle to a serial port.
|
||||
asio::error_code assign(implementation_type& impl,
|
||||
const native_type& native_handle, asio::error_code& ec)
|
||||
const native_handle_type& handle, asio::error_code& ec)
|
||||
{
|
||||
return service_impl_.assign(impl, native_handle, ec);
|
||||
return service_impl_.assign(impl, handle, ec);
|
||||
}
|
||||
|
||||
/// Determine whether the handle is open.
|
||||
@ -121,10 +128,16 @@ public:
|
||||
return service_impl_.close(impl, ec);
|
||||
}
|
||||
|
||||
/// Get the native handle implementation.
|
||||
/// (Deprecated: Use native_handle().) Get the native handle implementation.
|
||||
native_type native(implementation_type& impl)
|
||||
{
|
||||
return service_impl_.native(impl);
|
||||
return service_impl_.native_handle(impl);
|
||||
}
|
||||
|
||||
/// Get the native handle implementation.
|
||||
native_handle_type native_handle(implementation_type& impl)
|
||||
{
|
||||
return service_impl_.native_handle(impl);
|
||||
}
|
||||
|
||||
/// Cancel all asynchronous operations associated with the handle.
|
||||
|
@ -67,11 +67,18 @@ public:
|
||||
typedef typename service_impl_type::implementation_type implementation_type;
|
||||
#endif
|
||||
|
||||
/// The native acceptor type.
|
||||
/// (Deprecated: Use native_handle_type.) The native acceptor 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 acceptor 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 socket acceptor service for the specified io_service.
|
||||
@ -109,7 +116,7 @@ public:
|
||||
|
||||
/// Assign an existing native acceptor to a socket acceptor.
|
||||
asio::error_code assign(implementation_type& impl,
|
||||
const protocol_type& protocol, const native_type& native_acceptor,
|
||||
const protocol_type& protocol, const native_handle_type& native_acceptor,
|
||||
asio::error_code& ec)
|
||||
{
|
||||
return service_impl_.assign(impl, protocol, native_acceptor, ec);
|
||||
@ -150,10 +157,16 @@ public:
|
||||
return service_impl_.close(impl, ec);
|
||||
}
|
||||
|
||||
/// Get the native acceptor implementation.
|
||||
/// (Deprecated: Use native_handle().) Get the native acceptor implementation.
|
||||
native_type native(implementation_type& impl)
|
||||
{
|
||||
return service_impl_.native(impl);
|
||||
return service_impl_.native_handle(impl);
|
||||
}
|
||||
|
||||
/// Get the native acceptor implementation.
|
||||
native_handle_type native_handle(implementation_type& impl)
|
||||
{
|
||||
return service_impl_.native_handle(impl);
|
||||
}
|
||||
|
||||
/// Set a socket option.
|
||||
|
@ -67,11 +67,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 stream socket service for the specified io_service.
|
||||
@ -113,7 +120,7 @@ public:
|
||||
|
||||
/// Assign an existing native socket to a stream socket.
|
||||
asio::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,
|
||||
asio::error_code& ec)
|
||||
{
|
||||
return service_impl_.assign(impl, protocol, native_socket, ec);
|
||||
@ -132,10 +139,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.
|
||||
|
@ -44,8 +44,12 @@ class basic_handle
|
||||
: public basic_io_object<HandleService>
|
||||
{
|
||||
public:
|
||||
/// (Deprecated: Use native_handle_type.) The native representation of a
|
||||
/// handle.
|
||||
typedef typename HandleService::native_handle_type native_type;
|
||||
|
||||
/// The native representation of a handle.
|
||||
typedef typename HandleService::native_type native_type;
|
||||
typedef typename HandleService::native_handle_type native_handle_type;
|
||||
|
||||
/// A basic_handle is always the lowest layer.
|
||||
typedef basic_handle<HandleService> lowest_layer_type;
|
||||
@ -69,16 +73,16 @@ public:
|
||||
* @param io_service The io_service object that the handle will use to
|
||||
* dispatch handlers for any asynchronous operations performed on the handle.
|
||||
*
|
||||
* @param native_handle A native handle.
|
||||
* @param handle A native handle.
|
||||
*
|
||||
* @throws asio::system_error Thrown on failure.
|
||||
*/
|
||||
basic_handle(asio::io_service& io_service,
|
||||
const native_type& native_handle)
|
||||
const native_handle_type& handle)
|
||||
: basic_io_object<HandleService>(io_service)
|
||||
{
|
||||
asio::error_code ec;
|
||||
this->service.assign(this->implementation, native_handle, ec);
|
||||
this->service.assign(this->implementation, handle, ec);
|
||||
asio::detail::throw_error(ec);
|
||||
}
|
||||
|
||||
@ -114,14 +118,14 @@ public:
|
||||
/*
|
||||
* This function opens the handle to hold an existing native handle.
|
||||
*
|
||||
* @param native_handle A native handle.
|
||||
* @param handle A native handle.
|
||||
*
|
||||
* @throws asio::system_error Thrown on failure.
|
||||
*/
|
||||
void assign(const native_type& native_handle)
|
||||
void assign(const native_handle_type& handle)
|
||||
{
|
||||
asio::error_code ec;
|
||||
this->service.assign(this->implementation, native_handle, ec);
|
||||
this->service.assign(this->implementation, handle, ec);
|
||||
asio::detail::throw_error(ec);
|
||||
}
|
||||
|
||||
@ -129,14 +133,14 @@ public:
|
||||
/*
|
||||
* This function opens the handle to hold an existing native handle.
|
||||
*
|
||||
* @param native_handle A native handle.
|
||||
* @param handle A native handle.
|
||||
*
|
||||
* @param ec Set to indicate what error occurred, if any.
|
||||
*/
|
||||
asio::error_code assign(const native_type& native_handle,
|
||||
asio::error_code assign(const native_handle_type& handle,
|
||||
asio::error_code& ec)
|
||||
{
|
||||
return this->service.assign(this->implementation, native_handle, ec);
|
||||
return this->service.assign(this->implementation, handle, ec);
|
||||
}
|
||||
|
||||
/// Determine whether the handle is open.
|
||||
@ -173,7 +177,7 @@ public:
|
||||
return this->service.close(this->implementation, ec);
|
||||
}
|
||||
|
||||
/// Get the native handle representation.
|
||||
/// (Deprecated: Use native_handle().) Get the native handle representation.
|
||||
/**
|
||||
* This function may be used to obtain the underlying representation of the
|
||||
* handle. This is intended to allow access to native handle functionality
|
||||
@ -181,7 +185,18 @@ public:
|
||||
*/
|
||||
native_type native()
|
||||
{
|
||||
return this->service.native(this->implementation);
|
||||
return this->service.native_handle(this->implementation);
|
||||
}
|
||||
|
||||
/// Get the native handle representation.
|
||||
/**
|
||||
* This function may be used to obtain the underlying representation of the
|
||||
* handle. This is intended to allow access to native handle functionality
|
||||
* that is not otherwise provided.
|
||||
*/
|
||||
native_handle_type native_handle()
|
||||
{
|
||||
return this->service.native_handle(this->implementation);
|
||||
}
|
||||
|
||||
/// Cancel all asynchronous operations associated with the handle.
|
||||
|
@ -46,8 +46,13 @@ class basic_random_access_handle
|
||||
: public basic_handle<RandomAccessHandleService>
|
||||
{
|
||||
public:
|
||||
/// (Deprecated: Use native_handle_type.) The native representation of a
|
||||
/// handle.
|
||||
typedef typename RandomAccessHandleService::native_handle_type native_type;
|
||||
|
||||
/// The native representation of a handle.
|
||||
typedef typename RandomAccessHandleService::native_type native_type;
|
||||
typedef typename RandomAccessHandleService::native_handle_type
|
||||
native_handle_type;
|
||||
|
||||
/// Construct a basic_random_access_handle without opening it.
|
||||
/**
|
||||
@ -72,13 +77,13 @@ public:
|
||||
* use to dispatch handlers for any asynchronous operations performed on the
|
||||
* handle.
|
||||
*
|
||||
* @param native_handle The new underlying handle implementation.
|
||||
* @param handle The new underlying handle implementation.
|
||||
*
|
||||
* @throws asio::system_error Thrown on failure.
|
||||
*/
|
||||
basic_random_access_handle(asio::io_service& io_service,
|
||||
const native_type& native_handle)
|
||||
: basic_handle<RandomAccessHandleService>(io_service, native_handle)
|
||||
const native_handle_type& handle)
|
||||
: basic_handle<RandomAccessHandleService>(io_service, handle)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -49,8 +49,12 @@ class basic_stream_handle
|
||||
: public basic_handle<StreamHandleService>
|
||||
{
|
||||
public:
|
||||
/// (Deprecated: Use native_handle_type.) The native representation of a
|
||||
/// handle.
|
||||
typedef typename StreamHandleService::native_handle_type native_type;
|
||||
|
||||
/// The native representation of a handle.
|
||||
typedef typename StreamHandleService::native_type native_type;
|
||||
typedef typename StreamHandleService::native_handle_type native_handle_type;
|
||||
|
||||
/// Construct a basic_stream_handle without opening it.
|
||||
/**
|
||||
@ -74,13 +78,13 @@ public:
|
||||
* @param io_service The io_service object that the stream handle will use to
|
||||
* dispatch handlers for any asynchronous operations performed on the handle.
|
||||
*
|
||||
* @param native_handle The new underlying handle implementation.
|
||||
* @param handle The new underlying handle implementation.
|
||||
*
|
||||
* @throws asio::system_error Thrown on failure.
|
||||
*/
|
||||
basic_stream_handle(asio::io_service& io_service,
|
||||
const native_type& native_handle)
|
||||
: basic_handle<StreamHandleService>(io_service, native_handle)
|
||||
const native_handle_type& handle)
|
||||
: basic_handle<StreamHandleService>(io_service, handle)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -58,11 +58,18 @@ public:
|
||||
typedef service_impl_type::implementation_type implementation_type;
|
||||
#endif
|
||||
|
||||
/// The native handle type.
|
||||
/// (Deprecated: Use native_handle_type.) The native handle type.
|
||||
#if defined(GENERATING_DOCUMENTATION)
|
||||
typedef implementation_defined native_type;
|
||||
#else
|
||||
typedef service_impl_type::native_type native_type;
|
||||
typedef service_impl_type::native_handle_type native_type;
|
||||
#endif
|
||||
|
||||
/// The native handle type.
|
||||
#if defined(GENERATING_DOCUMENTATION)
|
||||
typedef implementation_defined native_handle_type;
|
||||
#else
|
||||
typedef service_impl_type::native_handle_type native_handle_type;
|
||||
#endif
|
||||
|
||||
/// Construct a new random-access handle service for the specified io_service.
|
||||
@ -93,9 +100,9 @@ public:
|
||||
|
||||
/// Assign an existing native handle to a random-access handle.
|
||||
asio::error_code assign(implementation_type& impl,
|
||||
const native_type& native_handle, asio::error_code& ec)
|
||||
const native_handle_type& handle, asio::error_code& ec)
|
||||
{
|
||||
return service_impl_.assign(impl, native_handle, ec);
|
||||
return service_impl_.assign(impl, handle, ec);
|
||||
}
|
||||
|
||||
/// Determine whether the handle is open.
|
||||
@ -111,10 +118,16 @@ public:
|
||||
return service_impl_.close(impl, ec);
|
||||
}
|
||||
|
||||
/// Get the native handle implementation.
|
||||
/// (Deprecated: Use native_handle().) Get the native handle implementation.
|
||||
native_type native(implementation_type& impl)
|
||||
{
|
||||
return service_impl_.native(impl);
|
||||
return service_impl_.native_handle(impl);
|
||||
}
|
||||
|
||||
/// Get the native handle implementation.
|
||||
native_handle_type native_handle(implementation_type& impl)
|
||||
{
|
||||
return service_impl_.native_handle(impl);
|
||||
}
|
||||
|
||||
/// Cancel all asynchronous operations associated with the handle.
|
||||
|
@ -56,11 +56,18 @@ public:
|
||||
typedef service_impl_type::implementation_type implementation_type;
|
||||
#endif
|
||||
|
||||
/// The native handle type.
|
||||
/// (Deprecated: Use native_handle_type.) The native handle type.
|
||||
#if defined(GENERATING_DOCUMENTATION)
|
||||
typedef implementation_defined native_type;
|
||||
#else
|
||||
typedef service_impl_type::native_type native_type;
|
||||
typedef service_impl_type::native_handle_type native_type;
|
||||
#endif
|
||||
|
||||
/// The native handle type.
|
||||
#if defined(GENERATING_DOCUMENTATION)
|
||||
typedef implementation_defined native_handle_type;
|
||||
#else
|
||||
typedef service_impl_type::native_handle_type native_handle_type;
|
||||
#endif
|
||||
|
||||
/// Construct a new stream handle service for the specified io_service.
|
||||
@ -90,9 +97,9 @@ public:
|
||||
|
||||
/// Assign an existing native handle to a stream handle.
|
||||
asio::error_code assign(implementation_type& impl,
|
||||
const native_type& native_handle, asio::error_code& ec)
|
||||
const native_handle_type& handle, asio::error_code& ec)
|
||||
{
|
||||
return service_impl_.assign(impl, native_handle, ec);
|
||||
return service_impl_.assign(impl, handle, ec);
|
||||
}
|
||||
|
||||
/// Determine whether the handle is open.
|
||||
@ -108,10 +115,16 @@ public:
|
||||
return service_impl_.close(impl, ec);
|
||||
}
|
||||
|
||||
/// Get the native handle implementation.
|
||||
/// (Deprecated: Use native_handle().) Get the native handle implementation.
|
||||
native_type native(implementation_type& impl)
|
||||
{
|
||||
return service_impl_.native(impl);
|
||||
return service_impl_.native_handle(impl);
|
||||
}
|
||||
|
||||
/// Get the native handle implementation.
|
||||
native_handle_type native_handle(implementation_type& impl)
|
||||
{
|
||||
return service_impl_.native_handle(impl);
|
||||
}
|
||||
|
||||
/// Cancel all asynchronous operations associated with the handle.
|
||||
|
@ -13,14 +13,14 @@ additional requirements listed below.
|
||||
|
||||
In the table below, `X` denotes a descriptor service class, `a` denotes a value
|
||||
of type `X`, `b` denotes a value of type `X::implementation_type`, `n` denotes
|
||||
a value of type `X::native_type`, `ec` denotes a value of type `error_code`,
|
||||
`i` denotes a value meeting [link asio.reference.IoControlCommand
|
||||
a value of type `X::native_handle_type`, `ec` denotes a value of type
|
||||
`error_code`, `i` denotes a value meeting [link asio.reference.IoControlCommand
|
||||
`IoControlCommand`] requirements, and `u` and `v` denote identifiers.
|
||||
|
||||
[table DescriptorService requirements
|
||||
[[expression] [return type] [assertion/note\npre/post-condition]]
|
||||
[
|
||||
[`X::native_type`]
|
||||
[`X::native_handle_type`]
|
||||
[]
|
||||
[
|
||||
The implementation-defined native representation of a descriptor. Must
|
||||
@ -88,9 +88,9 @@ a value of type `X::native_type`, `ec` denotes a value of type `error_code`,
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.native(b);
|
||||
a.native_handle(b);
|
||||
``]
|
||||
[`X::native_type`]
|
||||
[`X::native_handle_type`]
|
||||
[
|
||||
]
|
||||
]
|
||||
|
@ -13,13 +13,13 @@ additional requirements listed below.
|
||||
|
||||
In the table below, `X` denotes a handle service class, `a` denotes a value of
|
||||
type `X`, `b` denotes a value of type `X::implementation_type`, `n` denotes a
|
||||
value of type `X::native_type`, `ec` denotes a value of type `error_code`, and
|
||||
`u` and `v` denote identifiers.
|
||||
value of type `X::native_handle_type`, `ec` denotes a value of type
|
||||
`error_code`, and `u` and `v` denote identifiers.
|
||||
|
||||
[table HandleService requirements
|
||||
[[expression] [return type] [assertion/note\npre/post-condition]]
|
||||
[
|
||||
[`X::native_type`]
|
||||
[`X::native_handle_type`]
|
||||
[]
|
||||
[
|
||||
The implementation-defined native representation of a handle. Must
|
||||
@ -87,9 +87,9 @@ value of type `X::native_type`, `ec` denotes a value of type `error_code`, and
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.native(b);
|
||||
a.native_handle(b);
|
||||
``]
|
||||
[`X::native_type`]
|
||||
[`X::native_handle_type`]
|
||||
[
|
||||
]
|
||||
]
|
||||
|
@ -14,8 +14,8 @@ additional requirements listed below.
|
||||
In the table below, `X` denotes a serial port service class, `a` denotes a
|
||||
value of type `X`, `d` denotes a serial port device name of type `std::string`,
|
||||
`b` denotes a value of type `X::implementation_type`, `n` denotes a value of
|
||||
type `X::native_type`, `ec` denotes a value of type `error_code`, `s` denotes a
|
||||
value meeting [link asio.reference.SettableSerialPortOption
|
||||
type `X::native_handle_type`, `ec` denotes a value of type `error_code`, `s`
|
||||
denotes a value meeting [link asio.reference.SettableSerialPortOption
|
||||
`SettableSerialPortOption`] requirements, `g` denotes a value meeting [link
|
||||
asio.reference.GettableSerialPortOption `GettableSerialPortOption`]
|
||||
requirements, `mb` denotes a value satisfying [link
|
||||
@ -29,7 +29,7 @@ requirements. and `u` and `v` denote identifiers.
|
||||
[table SerialPortService requirements
|
||||
[[expression] [return type] [assertion/note\npre/post-condition]]
|
||||
[
|
||||
[`X::native_type`]
|
||||
[`X::native_handle_type`]
|
||||
[]
|
||||
[
|
||||
The implementation-defined native representation of a serial port. Must
|
||||
@ -108,9 +108,9 @@ requirements. and `u` and `v` denote identifiers.
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.native(b);
|
||||
a.native_handle(b);
|
||||
``]
|
||||
[`X::native_type`]
|
||||
[`X::native_handle_type`]
|
||||
[
|
||||
]
|
||||
]
|
||||
|
@ -14,12 +14,12 @@ additional requirements listed below.
|
||||
In the table below, `X` denotes a socket acceptor service class for protocol
|
||||
[link asio.reference.Protocol `Protocol`], `a` denotes a value of type
|
||||
`X`, `b` denotes a value of type `X::implementation_type`, `p` denotes a value
|
||||
of type `Protocol`, `n` denotes a value of type `X::native_type`, `e` denotes a
|
||||
value of type `Protocol::endpoint`, `ec` denotes a value of type `error_code`,
|
||||
`s` denotes a value meeting [link asio.reference.SettableSocketOption
|
||||
`SettableSocketOption`] requirements, `g` denotes a value meeting [link
|
||||
asio.reference.GettableSocketOption `GettableSocketOption`]
|
||||
requirements, `i` denotes a value meeting [link
|
||||
of type `Protocol`, `n` denotes a value of type `X::native_handle_type`, `e`
|
||||
denotes a value of type `Protocol::endpoint`, `ec` denotes a value of type
|
||||
`error_code`, `s` denotes a value meeting [link
|
||||
asio.reference.SettableSocketOption `SettableSocketOption`] requirements, `g`
|
||||
denotes a value meeting [link asio.reference.GettableSocketOption
|
||||
`GettableSocketOption`] requirements, `i` denotes a value meeting [link
|
||||
asio.reference.IoControlCommand `IoControlCommand`] requirements, `k`
|
||||
denotes a value of type `basic_socket<Protocol, SocketService>` where
|
||||
`SocketService` is a type meeting [link asio.reference.SocketService
|
||||
@ -30,7 +30,7 @@ and `v` denote identifiers.
|
||||
[table SocketAcceptorService requirements
|
||||
[[expression] [return type] [assertion/note\npre/post-condition]]
|
||||
[
|
||||
[`X::native_type`]
|
||||
[`X::native_handle_type`]
|
||||
[]
|
||||
[
|
||||
The implementation-defined native representation of a socket acceptor.
|
||||
@ -108,9 +108,9 @@ and `v` denote identifiers.
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.native(b);
|
||||
a.native_handle(b);
|
||||
``]
|
||||
[`X::native_type`]
|
||||
[`X::native_handle_type`]
|
||||
[
|
||||
]
|
||||
]
|
||||
|
@ -14,12 +14,12 @@ additional requirements listed below.
|
||||
In the table below, `X` denotes a socket service class for protocol [link
|
||||
asio.reference.Protocol `Protocol`], `a` denotes a value of type `X`,
|
||||
`b` denotes a value of type `X::implementation_type`, `p` denotes a value of
|
||||
type `Protocol`, `n` denotes a value of type `X::native_type`, `e` denotes a
|
||||
value of type `Protocol::endpoint`, `ec` denotes a value of type `error_code`,
|
||||
`s` denotes a value meeting [link asio.reference.SettableSocketOption
|
||||
`SettableSocketOption`] requirements, `g` denotes a value meeting [link
|
||||
asio.reference.GettableSocketOption `GettableSocketOption`]
|
||||
requirements, `i` denotes a value meeting [link
|
||||
type `Protocol`, `n` denotes a value of type `X::native_handle_type`, `e`
|
||||
denotes a value of type `Protocol::endpoint`, `ec` denotes a value of type
|
||||
`error_code`, `s` denotes a value meeting [link
|
||||
asio.reference.SettableSocketOption `SettableSocketOption`] requirements, `g`
|
||||
denotes a value meeting [link asio.reference.GettableSocketOption
|
||||
`GettableSocketOption`] requirements, `i` denotes a value meeting [link
|
||||
asio.reference.IoControlCommand `IoControlCommand`] requirements, `h`
|
||||
denotes a value of type `socket_base::shutdown_type`, `ch` denotes a value
|
||||
meeting [link asio.reference.ConnectHandler `ConnectHandler`]
|
||||
@ -28,7 +28,7 @@ requirements, and `u` and `v` denote identifiers.
|
||||
[table SocketService requirements
|
||||
[[expression] [return type] [assertion/note\npre/post-condition]]
|
||||
[
|
||||
[`X::native_type`]
|
||||
[`X::native_handle_type`]
|
||||
[]
|
||||
[
|
||||
The implementation-defined native representation of a socket. Must
|
||||
@ -106,9 +106,9 @@ requirements, and `u` and `v` denote identifiers.
|
||||
]
|
||||
[
|
||||
[``
|
||||
a.native(b);
|
||||
a.native_handle(b);
|
||||
``]
|
||||
[`X::native_type`]
|
||||
[`X::native_handle_type`]
|
||||
[
|
||||
]
|
||||
]
|
||||
|
@ -41,7 +41,7 @@ public:
|
||||
typedef typename service_impl_type::implementation_type implementation_type;
|
||||
|
||||
/// The native type of a stream socket.
|
||||
typedef typename service_impl_type::native_type native_type;
|
||||
typedef typename service_impl_type::native_handle_type native_handle_type;
|
||||
|
||||
/// Construct a new stream socket service for the specified io_service.
|
||||
explicit stream_socket_service(asio::io_service& io_service)
|
||||
@ -78,7 +78,7 @@ public:
|
||||
|
||||
/// Open a stream socket from an existing native socket.
|
||||
asio::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,
|
||||
asio::error_code& ec)
|
||||
{
|
||||
logger_.log("Assigning from a native socket");
|
||||
|
@ -31,8 +31,8 @@ void transmit_file(tcp::socket& socket,
|
||||
overlapped_ptr overlapped(socket.get_io_service(), handler);
|
||||
|
||||
// Initiate the TransmitFile operation.
|
||||
BOOL ok = ::TransmitFile(socket.native(),
|
||||
file.native(), 0, 0, overlapped.get(), 0, 0);
|
||||
BOOL ok = ::TransmitFile(socket.native_handle(),
|
||||
file.native_handle(), 0, 0, overlapped.get(), 0, 0);
|
||||
DWORD last_error = ::GetLastError();
|
||||
|
||||
// Check if the operation completed immediately.
|
||||
|
@ -203,6 +203,10 @@ void test()
|
||||
ip::tcp::socket::native_type native_socket4 = socket1.native();
|
||||
(void)native_socket4;
|
||||
|
||||
ip::tcp::socket::native_handle_type native_socket5
|
||||
= socket1.native_handle();
|
||||
(void)native_socket5;
|
||||
|
||||
socket1.cancel();
|
||||
socket1.cancel(ec);
|
||||
|
||||
|
@ -103,6 +103,10 @@ void test()
|
||||
ip::udp::socket::native_type native_socket4 = socket1.native();
|
||||
(void)native_socket4;
|
||||
|
||||
ip::udp::socket::native_handle_type native_socket5
|
||||
= socket1.native_handle();
|
||||
(void)native_socket5;
|
||||
|
||||
socket1.cancel();
|
||||
socket1.cancel(ec);
|
||||
|
||||
|
@ -86,6 +86,10 @@ void test()
|
||||
= descriptor1.native();
|
||||
(void)native_descriptor3;
|
||||
|
||||
posix::stream_descriptor::native_handle_type native_descriptor4
|
||||
= descriptor1.native_handle();
|
||||
(void)native_descriptor4;
|
||||
|
||||
descriptor1.cancel();
|
||||
descriptor1.cancel(ec);
|
||||
|
||||
|
@ -54,7 +54,7 @@ void test()
|
||||
|
||||
serial_port port1(ios);
|
||||
serial_port port2(ios, "null");
|
||||
serial_port::native_type native_port1 = port1.native();
|
||||
serial_port::native_handle_type native_port1 = port1.native_handle();
|
||||
serial_port port3(ios, native_port1);
|
||||
|
||||
// basic_io_object functions.
|
||||
@ -74,9 +74,9 @@ void test()
|
||||
port1.open("null");
|
||||
port1.open("null", ec);
|
||||
|
||||
serial_port::native_type native_port2 = port1.native();
|
||||
serial_port::native_handle_type native_port2 = port1.native_handle();
|
||||
port1.assign(native_port2);
|
||||
serial_port::native_type native_port3 = port1.native();
|
||||
serial_port::native_handle_type native_port3 = port1.native_handle();
|
||||
port1.assign(native_port3, ec);
|
||||
|
||||
bool is_open = port1.is_open();
|
||||
@ -88,6 +88,9 @@ void test()
|
||||
serial_port::native_type native_port4 = port1.native();
|
||||
(void)native_port4;
|
||||
|
||||
serial_port::native_handle_type native_port5 = port1.native_handle();
|
||||
(void)native_port5;
|
||||
|
||||
port1.cancel();
|
||||
port1.cancel(ec);
|
||||
|
||||
|
@ -85,6 +85,10 @@ void test()
|
||||
win::random_access_handle::native_type native_handle3 = handle1.native();
|
||||
(void)native_handle3;
|
||||
|
||||
win::random_access_handle::native_handle_type native_handle4
|
||||
= handle1.native_handle();
|
||||
(void)native_handle4;
|
||||
|
||||
handle1.cancel();
|
||||
handle1.cancel(ec);
|
||||
|
||||
|
@ -84,6 +84,10 @@ void test()
|
||||
win::stream_handle::native_type native_handle3 = handle1.native();
|
||||
(void)native_handle3;
|
||||
|
||||
win::stream_handle::native_handle_type native_handle4
|
||||
= handle1.native_handle();
|
||||
(void)native_handle4;
|
||||
|
||||
handle1.cancel();
|
||||
handle1.cancel(ec);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user