Clementine
|
Provides datagram-oriented socket functionality. More...
#include <basic_datagram_socket.hpp>
Classes | |
struct | rebind_executor |
Rebinds the socket type to another executor. More... | |
Public Types | |
typedef Executor | executor_type |
The type of the executor associated with the object. | |
typedef basic_socket< Protocol, Executor >::native_handle_type | native_handle_type |
The native representation of a socket. | |
typedef Protocol | protocol_type |
The protocol type. | |
typedef Protocol::endpoint | endpoint_type |
The endpoint type. | |
![]() | |
typedef Executor | executor_type |
The type of the executor associated with the object. | |
typedef detail::reactive_socket_service< Protocol >::native_handle_type | native_handle_type |
The native representation of a socket. | |
typedef Protocol | protocol_type |
The protocol type. | |
typedef Protocol::endpoint | endpoint_type |
The endpoint type. | |
typedef basic_socket< Protocol, Executor > | lowest_layer_type |
A basic_socket is always the lowest layer. | |
![]() | |
enum | shutdown_type { shutdown_receive = ASIO_OS_DEF(SHUT_RD), shutdown_send = ASIO_OS_DEF(SHUT_WR), shutdown_both = ASIO_OS_DEF(SHUT_RDWR) } |
Different ways a socket may be shutdown. | |
enum | wait_type { wait_read, wait_write, wait_error } |
Wait types. More... | |
typedef int | message_flags |
Bitmask type for flags that can be passed to send and receive operations. | |
typedef asio::detail::socket_option::boolean< ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_BROADCAST)> | broadcast |
Socket option to permit sending of broadcast messages. More... | |
typedef asio::detail::socket_option::boolean< ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_DEBUG)> | debug |
Socket option to enable socket-level debugging. More... | |
typedef asio::detail::socket_option::boolean< ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_DONTROUTE)> | do_not_route |
Socket option to prevent routing, use local interfaces only. More... | |
typedef asio::detail::socket_option::boolean< ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_KEEPALIVE)> | keep_alive |
Socket option to send keep-alives. More... | |
typedef asio::detail::socket_option::integer< ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_SNDBUF)> | send_buffer_size |
Socket option for the send buffer size of a socket. More... | |
typedef asio::detail::socket_option::integer< ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_SNDLOWAT)> | send_low_watermark |
Socket option for the send low watermark. More... | |
typedef asio::detail::socket_option::integer< ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_RCVBUF)> | receive_buffer_size |
Socket option for the receive buffer size of a socket. More... | |
typedef asio::detail::socket_option::integer< ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_RCVLOWAT)> | receive_low_watermark |
Socket option for the receive low watermark. More... | |
typedef asio::detail::socket_option::boolean< ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_REUSEADDR)> | reuse_address |
Socket option to allow the socket to be bound to an address that is already in use. More... | |
typedef asio::detail::socket_option::linger< ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_LINGER)> | linger |
Socket option to specify whether the socket lingers on close if unsent data is present. More... | |
typedef asio::detail::socket_option::boolean< ASIO_OS_DEF(SOL_SOCKET), ASIO_OS_DEF(SO_OOBINLINE)> | out_of_band_inline |
Socket option for putting received out-of-band data inline. More... | |
typedef asio::detail::socket_option::boolean< asio::detail::custom_socket_option_level, asio::detail::enable_connection_aborted_option > | enable_connection_aborted |
Socket option to report aborted connections on accept. More... | |
typedef asio::detail::io_control::bytes_readable | bytes_readable |
IO control command to get the amount of data that can be read without blocking. More... | |
Public Member Functions | |
basic_datagram_socket (const executor_type &ex) | |
Construct a basic_datagram_socket without opening it. More... | |
template<typename ExecutionContext > | |
basic_datagram_socket (ExecutionContext &context, typename enable_if< is_convertible< ExecutionContext &, execution_context &>::value >::type *=0) | |
Construct a basic_datagram_socket without opening it. More... | |
basic_datagram_socket (const executor_type &ex, const protocol_type &protocol) | |
Construct and open a basic_datagram_socket. More... | |
template<typename ExecutionContext > | |
basic_datagram_socket (ExecutionContext &context, const protocol_type &protocol, typename enable_if< is_convertible< ExecutionContext &, execution_context &>::value >::type *=0) | |
Construct and open a basic_datagram_socket. More... | |
basic_datagram_socket (const executor_type &ex, const endpoint_type &endpoint) | |
Construct a basic_datagram_socket, opening it and binding it to the given local endpoint. More... | |
template<typename ExecutionContext > | |
basic_datagram_socket (ExecutionContext &context, const endpoint_type &endpoint, typename enable_if< is_convertible< ExecutionContext &, execution_context &>::value >::type *=0) | |
Construct a basic_datagram_socket, opening it and binding it to the given local endpoint. More... | |
basic_datagram_socket (const executor_type &ex, const protocol_type &protocol, const native_handle_type &native_socket) | |
Construct a basic_datagram_socket on an existing native socket. More... | |
template<typename ExecutionContext > | |
basic_datagram_socket (ExecutionContext &context, const protocol_type &protocol, const native_handle_type &native_socket, typename enable_if< is_convertible< ExecutionContext &, execution_context &>::value >::type *=0) | |
Construct a basic_datagram_socket on an existing native socket. More... | |
~basic_datagram_socket () | |
Destroys the socket. More... | |
template<typename ConstBufferSequence > | |
std::size_t | send (const ConstBufferSequence &buffers) |
Send some data on a connected socket. More... | |
template<typename ConstBufferSequence > | |
std::size_t | send (const ConstBufferSequence &buffers, socket_base::message_flags flags) |
Send some data on a connected socket. More... | |
template<typename ConstBufferSequence > | |
std::size_t | send (const ConstBufferSequence &buffers, socket_base::message_flags flags, asio::error_code &ec) |
Send some data on a connected socket. More... | |
template<typename ConstBufferSequence , ASIO_COMPLETION_TOKEN_FOR(void(asio::error_code, std::size_t)) WriteHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type) > | |
ASIO_INITFN_AUTO_RESULT_TYPE (WriteHandler, void(asio::error_code, std::size_t)) async_send(const ConstBufferSequence &buffers | |
Start an asynchronous send on a connected socket. More... | |
ASIO_MOVE_ARG (WriteHandler) handler ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) | |
template<typename ConstBufferSequence , ASIO_COMPLETION_TOKEN_FOR(void(asio::error_code, std::size_t)) WriteHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type) > | |
ASIO_INITFN_AUTO_RESULT_TYPE (WriteHandler, void(asio::error_code, std::size_t)) async_send(const ConstBufferSequence &buffers | |
Start an asynchronous send on a connected socket. More... | |
socket_base::message_flags | ASIO_MOVE_ARG (WriteHandler) handler ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) |
template<typename ConstBufferSequence > | |
std::size_t | send_to (const ConstBufferSequence &buffers, const endpoint_type &destination) |
Send a datagram to the specified endpoint. More... | |
template<typename ConstBufferSequence > | |
std::size_t | send_to (const ConstBufferSequence &buffers, const endpoint_type &destination, socket_base::message_flags flags) |
Send a datagram to the specified endpoint. More... | |
template<typename ConstBufferSequence > | |
std::size_t | send_to (const ConstBufferSequence &buffers, const endpoint_type &destination, socket_base::message_flags flags, asio::error_code &ec) |
Send a datagram to the specified endpoint. More... | |
template<typename ConstBufferSequence , ASIO_COMPLETION_TOKEN_FOR(void(asio::error_code, std::size_t)) WriteHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type) > | |
ASIO_INITFN_AUTO_RESULT_TYPE (WriteHandler, void(asio::error_code, std::size_t)) async_send_to(const ConstBufferSequence &buffers | |
Start an asynchronous send. More... | |
const endpoint_type | ASIO_MOVE_ARG (WriteHandler) handler ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) |
template<typename ConstBufferSequence , ASIO_COMPLETION_TOKEN_FOR(void(asio::error_code, std::size_t)) WriteHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type) > | |
ASIO_INITFN_AUTO_RESULT_TYPE (WriteHandler, void(asio::error_code, std::size_t)) async_send_to(const ConstBufferSequence &buffers | |
Start an asynchronous send. More... | |
const endpoint_type socket_base::message_flags | ASIO_MOVE_ARG (WriteHandler) handler ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) |
template<typename MutableBufferSequence > | |
std::size_t | receive (const MutableBufferSequence &buffers) |
Receive some data on a connected socket. More... | |
template<typename MutableBufferSequence > | |
std::size_t | receive (const MutableBufferSequence &buffers, socket_base::message_flags flags) |
Receive some data on a connected socket. More... | |
template<typename MutableBufferSequence > | |
std::size_t | receive (const MutableBufferSequence &buffers, socket_base::message_flags flags, asio::error_code &ec) |
Receive some data on a connected socket. More... | |
template<typename MutableBufferSequence , ASIO_COMPLETION_TOKEN_FOR(void(asio::error_code, std::size_t)) ReadHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type) > | |
ASIO_INITFN_AUTO_RESULT_TYPE (ReadHandler, void(asio::error_code, std::size_t)) async_receive(const MutableBufferSequence &buffers | |
Start an asynchronous receive on a connected socket. More... | |
ASIO_MOVE_ARG (ReadHandler) handler ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) | |
template<typename MutableBufferSequence , ASIO_COMPLETION_TOKEN_FOR(void(asio::error_code, std::size_t)) ReadHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type) > | |
ASIO_INITFN_AUTO_RESULT_TYPE (ReadHandler, void(asio::error_code, std::size_t)) async_receive(const MutableBufferSequence &buffers | |
Start an asynchronous receive on a connected socket. More... | |
socket_base::message_flags | ASIO_MOVE_ARG (ReadHandler) handler ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) |
template<typename MutableBufferSequence > | |
std::size_t | receive_from (const MutableBufferSequence &buffers, endpoint_type &sender_endpoint) |
Receive a datagram with the endpoint of the sender. More... | |
template<typename MutableBufferSequence > | |
std::size_t | receive_from (const MutableBufferSequence &buffers, endpoint_type &sender_endpoint, socket_base::message_flags flags) |
Receive a datagram with the endpoint of the sender. More... | |
template<typename MutableBufferSequence > | |
std::size_t | receive_from (const MutableBufferSequence &buffers, endpoint_type &sender_endpoint, socket_base::message_flags flags, asio::error_code &ec) |
Receive a datagram with the endpoint of the sender. More... | |
template<typename MutableBufferSequence , ASIO_COMPLETION_TOKEN_FOR(void(asio::error_code, std::size_t)) ReadHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type) > | |
ASIO_INITFN_AUTO_RESULT_TYPE (ReadHandler, void(asio::error_code, std::size_t)) async_receive_from(const MutableBufferSequence &buffers | |
Start an asynchronous receive. More... | |
endpoint_type | ASIO_MOVE_ARG (ReadHandler) handler ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) |
template<typename MutableBufferSequence , ASIO_COMPLETION_TOKEN_FOR(void(asio::error_code, std::size_t)) ReadHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE(executor_type) > | |
ASIO_INITFN_AUTO_RESULT_TYPE (ReadHandler, void(asio::error_code, std::size_t)) async_receive_from(const MutableBufferSequence &buffers | |
Start an asynchronous receive. More... | |
endpoint_type socket_base::message_flags | ASIO_MOVE_ARG (ReadHandler) handler ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) |
![]() | |
basic_socket (const executor_type &ex) | |
Construct a basic_socket without opening it. More... | |
template<typename ExecutionContext > | |
basic_socket (ExecutionContext &context, typename enable_if< is_convertible< ExecutionContext &, execution_context &>::value >::type *=0) | |
Construct a basic_socket without opening it. More... | |
basic_socket (const executor_type &ex, const protocol_type &protocol) | |
Construct and open a basic_socket. More... | |
template<typename ExecutionContext > | |
basic_socket (ExecutionContext &context, const protocol_type &protocol, typename enable_if< is_convertible< ExecutionContext &, execution_context &>::value >::type *=0) | |
Construct and open a basic_socket. More... | |
basic_socket (const executor_type &ex, const endpoint_type &endpoint) | |
Construct a basic_socket, opening it and binding it to the given local endpoint. More... | |
template<typename ExecutionContext > | |
basic_socket (ExecutionContext &context, const endpoint_type &endpoint, typename enable_if< is_convertible< ExecutionContext &, execution_context &>::value >::type *=0) | |
Construct a basic_socket, opening it and binding it to the given local endpoint. More... | |
basic_socket (const executor_type &ex, const protocol_type &protocol, const native_handle_type &native_socket) | |
Construct a basic_socket on an existing native socket. More... | |
template<typename ExecutionContext > | |
basic_socket (ExecutionContext &context, const protocol_type &protocol, const native_handle_type &native_socket, typename enable_if< is_convertible< ExecutionContext &, execution_context &>::value >::type *=0) | |
Construct a basic_socket on an existing native socket. More... | |
executor_type | get_executor () ASIO_NOEXCEPT |
Get the executor associated with the object. | |
lowest_layer_type & | lowest_layer () |
Get a reference to the lowest layer. More... | |
const lowest_layer_type & | lowest_layer () const |
Get a const reference to the lowest layer. More... | |
void | open (const protocol_type &protocol=protocol_type()) |
Open the socket using the specified protocol. More... | |
ASIO_SYNC_OP_VOID | open (const protocol_type &protocol, asio::error_code &ec) |
Open the socket using the specified protocol. More... | |
void | assign (const protocol_type &protocol, const native_handle_type &native_socket) |
Assign an existing native socket to the socket. | |
ASIO_SYNC_OP_VOID | assign (const protocol_type &protocol, const native_handle_type &native_socket, asio::error_code &ec) |
Assign an existing native socket to the socket. | |
bool | is_open () const |
Determine whether the socket is open. | |
void | close () |
Close the socket. More... | |
ASIO_SYNC_OP_VOID | close (asio::error_code &ec) |
Close the socket. More... | |
native_handle_type | release () |
Release ownership of the underlying native socket. More... | |
native_handle_type | release (asio::error_code &ec) |
Release ownership of the underlying native socket. More... | |
native_handle_type | native_handle () |
Get the native socket representation. More... | |
void | cancel () |
Cancel all asynchronous operations associated with the socket. More... | |
ASIO_SYNC_OP_VOID | cancel (asio::error_code &ec) |
Cancel all asynchronous operations associated with the socket. More... | |
bool | at_mark () const |
Determine whether the socket is at the out-of-band data mark. More... | |
bool | at_mark (asio::error_code &ec) const |
Determine whether the socket is at the out-of-band data mark. More... | |
std::size_t | available () const |
Determine the number of bytes available for reading. More... | |
std::size_t | available (asio::error_code &ec) const |
Determine the number of bytes available for reading. More... | |
void | bind (const endpoint_type &endpoint) |
Bind the socket to the given local endpoint. More... | |
ASIO_SYNC_OP_VOID | bind (const endpoint_type &endpoint, asio::error_code &ec) |
Bind the socket to the given local endpoint. More... | |
void | connect (const endpoint_type &peer_endpoint) |
Connect the socket to the specified endpoint. More... | |
ASIO_SYNC_OP_VOID | connect (const endpoint_type &peer_endpoint, asio::error_code &ec) |
Connect the socket to the specified endpoint. More... | |
template<ConnectHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE> | |
ASIO_INITFN_AUTO_RESULT_TYPE (ConnectHandler, void(asio::error_code)) async_connect(const endpoint_type &peer_endpoint | |
Start an asynchronous connect. More... | |
ASIO_MOVE_ARG (ConnectHandler) handler ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) | |
template<typename SettableSocketOption > | |
void | set_option (const SettableSocketOption &option) |
Set an option on the socket. More... | |
template<typename SettableSocketOption > | |
ASIO_SYNC_OP_VOID | set_option (const SettableSocketOption &option, asio::error_code &ec) |
Set an option on the socket. More... | |
template<typename GettableSocketOption > | |
void | get_option (GettableSocketOption &option) const |
Get an option from the socket. More... | |
template<typename GettableSocketOption > | |
ASIO_SYNC_OP_VOID | get_option (GettableSocketOption &option, asio::error_code &ec) const |
Get an option from the socket. More... | |
template<typename IoControlCommand > | |
void | io_control (IoControlCommand &command) |
Perform an IO control command on the socket. More... | |
template<typename IoControlCommand > | |
ASIO_SYNC_OP_VOID | io_control (IoControlCommand &command, asio::error_code &ec) |
Perform an IO control command on the socket. More... | |
bool | non_blocking () const |
Gets the non-blocking mode of the socket. More... | |
void | non_blocking (bool mode) |
Sets the non-blocking mode of the socket. More... | |
ASIO_SYNC_OP_VOID | non_blocking (bool mode, asio::error_code &ec) |
Sets the non-blocking mode of the socket. More... | |
bool | native_non_blocking () const |
Gets the non-blocking mode of the native socket implementation. More... | |
void | native_non_blocking (bool mode) |
Sets the non-blocking mode of the native socket implementation. More... | |
ASIO_SYNC_OP_VOID | native_non_blocking (bool mode, asio::error_code &ec) |
Sets the non-blocking mode of the native socket implementation. More... | |
endpoint_type | local_endpoint () const |
Get the local endpoint of the socket. More... | |
endpoint_type | local_endpoint (asio::error_code &ec) const |
Get the local endpoint of the socket. More... | |
endpoint_type | remote_endpoint () const |
Get the remote endpoint of the socket. More... | |
endpoint_type | remote_endpoint (asio::error_code &ec) const |
Get the remote endpoint of the socket. More... | |
void | shutdown (shutdown_type what) |
Disable sends or receives on the socket. More... | |
ASIO_SYNC_OP_VOID | shutdown (shutdown_type what, asio::error_code &ec) |
Disable sends or receives on the socket. More... | |
void | wait (wait_type w) |
Wait for the socket to become ready to read, ready to write, or to have pending error conditions. More... | |
ASIO_SYNC_OP_VOID | wait (wait_type w, asio::error_code &ec) |
Wait for the socket to become ready to read, ready to write, or to have pending error conditions. More... | |
template<WaitHandler ASIO_DEFAULT_COMPLETION_TOKEN_TYPE> | |
ASIO_INITFN_AUTO_RESULT_TYPE (WaitHandler, void(asio::error_code)) async_wait(wait_type w | |
Asynchronously wait for the socket to become ready to read, ready to write, or to have pending error conditions. More... | |
ASIO_MOVE_ARG (WaitHandler) handler ASIO_DEFAULT_COMPLETION_TOKEN(executor_type)) | |
![]() | |
ASIO_STATIC_CONSTANT (int, message_peek=ASIO_OS_DEF(MSG_PEEK)) | |
ASIO_STATIC_CONSTANT (int, message_out_of_band=ASIO_OS_DEF(MSG_OOB)) | |
ASIO_STATIC_CONSTANT (int, message_do_not_route=ASIO_OS_DEF(MSG_DONTROUTE)) | |
ASIO_STATIC_CONSTANT (int, message_end_of_record=ASIO_OS_DEF(MSG_EOR)) | |
ASIO_STATIC_CONSTANT (int, max_listen_connections=ASIO_OS_DEF(SOMAXCONN)) | |
The maximum length of the queue of pending incoming connections. | |
ASIO_STATIC_CONSTANT (int, max_connections=ASIO_OS_DEF(SOMAXCONN)) | |
(Deprecated: Use max_listen_connections.) The maximum length of the queue of pending incoming connections. More... | |
Public Attributes | |
socket_base::message_flags | flags |
const endpoint_type & | destination |
const endpoint_type socket_base::message_flags | flags |
endpoint_type & | sender_endpoint |
endpoint_type socket_base::message_flags | flags |
Additional Inherited Members | |
![]() | |
~basic_socket () | |
Protected destructor to prevent deletion through this type. More... | |
![]() | |
~socket_base () | |
Protected destructor to prevent deletion through this type. | |
![]() | |
detail::io_object_impl< detail::reactive_socket_service< Protocol >, Executor > | impl_ |
Provides datagram-oriented socket functionality.
The basic_datagram_socket class template provides asynchronous and blocking datagram-oriented socket functionality.
|
inlineexplicit |
Construct a basic_datagram_socket without opening it.
This constructor creates a datagram socket without opening it. The open() function must be called before data can be sent or received on the socket.
ex | The I/O executor that the socket will use, by default, to dispatch handlers for any asynchronous operations performed on the socket. |
|
inlineexplicit |
Construct a basic_datagram_socket without opening it.
This constructor creates a datagram socket without opening it. The open() function must be called before data can be sent or received on the socket.
context | An execution context which provides the I/O executor that the socket will use, by default, to dispatch handlers for any asynchronous operations performed on the socket. |
|
inline |
Construct and open a basic_datagram_socket.
This constructor creates and opens a datagram socket.
ex | The I/O executor that the socket will use, by default, to dispatch handlers for any asynchronous operations performed on the socket. |
protocol | An object specifying protocol parameters to be used. |
asio::system_error | Thrown on failure. |
|
inline |
Construct and open a basic_datagram_socket.
This constructor creates and opens a datagram socket.
context | An execution context which provides the I/O executor that the socket will use, by default, to dispatch handlers for any asynchronous operations performed on the socket. |
protocol | An object specifying protocol parameters to be used. |
asio::system_error | Thrown on failure. |
|
inline |
Construct a basic_datagram_socket, opening it and binding it to the given local endpoint.
This constructor creates a datagram socket and automatically opens it bound to the specified endpoint on the local machine. The protocol used is the protocol associated with the given endpoint.
ex | The I/O executor that the socket will use, by default, to dispatch handlers for any asynchronous operations performed on the socket. |
endpoint | An endpoint on the local machine to which the datagram socket will be bound. |
asio::system_error | Thrown on failure. |
|
inline |
Construct a basic_datagram_socket, opening it and binding it to the given local endpoint.
This constructor creates a datagram socket and automatically opens it bound to the specified endpoint on the local machine. The protocol used is the protocol associated with the given endpoint.
context | An execution context which provides the I/O executor that the socket will use, by default, to dispatch handlers for any asynchronous operations performed on the socket. |
endpoint | An endpoint on the local machine to which the datagram socket will be bound. |
asio::system_error | Thrown on failure. |
|
inline |
Construct a basic_datagram_socket on an existing native socket.
This constructor creates a datagram socket object to hold an existing native socket.
ex | The I/O executor that the socket will use, by default, to dispatch handlers for any asynchronous operations performed on the socket. |
protocol | An object specifying protocol parameters to be used. |
native_socket | The new underlying socket implementation. |
asio::system_error | Thrown on failure. |
|
inline |
Construct a basic_datagram_socket on an existing native socket.
This constructor creates a datagram socket object to hold an existing native socket.
context | An execution context which provides the I/O executor that the socket will use, by default, to dispatch handlers for any asynchronous operations performed on the socket. |
protocol | An object specifying protocol parameters to be used. |
native_socket | The new underlying socket implementation. |
asio::system_error | Thrown on failure. |
|
inline |
Destroys the socket.
This function destroys the socket, cancelling any outstanding asynchronous operations associated with the socket as if by calling cancel
.
asio::basic_datagram_socket< Protocol, Executor >::ASIO_INITFN_AUTO_RESULT_TYPE | ( | WriteHandler | , |
void(asio::error_code, std::size_t) | |||
) | const & |
Start an asynchronous send on a connected socket.
This function is used to asynchronously send data on the datagram socket. The function call always returns immediately.
buffers | One or more data buffers to be sent on the socket. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called. |
handler | The handler to be called when the send operation completes. Copies will be made of the handler as required. The function signature of the handler must be: void handler( std::size_t bytes_transferred // Number of bytes sent. ); |
asio::basic_datagram_socket< Protocol, Executor >::ASIO_INITFN_AUTO_RESULT_TYPE | ( | WriteHandler | , |
void(asio::error_code, std::size_t) | |||
) | const & |
Start an asynchronous send on a connected socket.
This function is used to asynchronously send data on the datagram socket. The function call always returns immediately.
buffers | One or more data buffers to be sent on the socket. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called. |
flags | Flags specifying how the send call is to be made. |
handler | The handler to be called when the send operation completes. Copies will be made of the handler as required. The function signature of the handler must be: void handler( std::size_t bytes_transferred // Number of bytes sent. ); |
asio::basic_datagram_socket< Protocol, Executor >::ASIO_INITFN_AUTO_RESULT_TYPE | ( | WriteHandler | , |
void(asio::error_code, std::size_t) | |||
) | const & |
Start an asynchronous send.
This function is used to asynchronously send a datagram to the specified remote endpoint. The function call always returns immediately.
buffers | One or more data buffers to be sent to the remote endpoint. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called. |
destination | The remote endpoint to which the data will be sent. Copies will be made of the endpoint as required. |
handler | The handler to be called when the send operation completes. Copies will be made of the handler as required. The function signature of the handler must be: void handler( std::size_t bytes_transferred // Number of bytes sent. ); |
asio::basic_datagram_socket< Protocol, Executor >::ASIO_INITFN_AUTO_RESULT_TYPE | ( | WriteHandler | , |
void(asio::error_code, std::size_t) | |||
) | const & |
Start an asynchronous send.
This function is used to asynchronously send a datagram to the specified remote endpoint. The function call always returns immediately.
buffers | One or more data buffers to be sent to the remote endpoint. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called. |
flags | Flags specifying how the send call is to be made. |
destination | The remote endpoint to which the data will be sent. Copies will be made of the endpoint as required. |
handler | The handler to be called when the send operation completes. Copies will be made of the handler as required. The function signature of the handler must be: void handler( std::size_t bytes_transferred // Number of bytes sent. ); |
asio::basic_datagram_socket< Protocol, Executor >::ASIO_INITFN_AUTO_RESULT_TYPE | ( | ReadHandler | , |
void(asio::error_code, std::size_t) | |||
) | const & |
Start an asynchronous receive on a connected socket.
This function is used to asynchronously receive data from the datagram socket. The function call always returns immediately.
buffers | One or more buffers into which the data will be received. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called. |
handler | The handler to be called when the receive operation completes. Copies will be made of the handler as required. The function signature of the handler must be: void handler( std::size_t bytes_transferred // Number of bytes received. ); |
asio::basic_datagram_socket< Protocol, Executor >::ASIO_INITFN_AUTO_RESULT_TYPE | ( | ReadHandler | , |
void(asio::error_code, std::size_t) | |||
) | const & |
Start an asynchronous receive on a connected socket.
This function is used to asynchronously receive data from the datagram socket. The function call always returns immediately.
buffers | One or more buffers into which the data will be received. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called. |
flags | Flags specifying how the receive call is to be made. |
handler | The handler to be called when the receive operation completes. Copies will be made of the handler as required. The function signature of the handler must be: void handler( std::size_t bytes_transferred // Number of bytes received. ); |
asio::basic_datagram_socket< Protocol, Executor >::ASIO_INITFN_AUTO_RESULT_TYPE | ( | ReadHandler | , |
void(asio::error_code, std::size_t) | |||
) | const & |
Start an asynchronous receive.
This function is used to asynchronously receive a datagram. The function call always returns immediately.
buffers | One or more buffers into which the data will be received. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called. |
sender_endpoint | An endpoint object that receives the endpoint of the remote sender of the datagram. Ownership of the sender_endpoint object is retained by the caller, which must guarantee that it is valid until the handler is called. |
handler | The handler to be called when the receive operation completes. Copies will be made of the handler as required. The function signature of the handler must be: void handler( std::size_t bytes_transferred // Number of bytes received. ); |
asio::basic_datagram_socket< Protocol, Executor >::ASIO_INITFN_AUTO_RESULT_TYPE | ( | ReadHandler | , |
void(asio::error_code, std::size_t) | |||
) | const & |
Start an asynchronous receive.
This function is used to asynchronously receive a datagram. The function call always returns immediately.
buffers | One or more buffers into which the data will be received. Although the buffers object may be copied as necessary, ownership of the underlying memory blocks is retained by the caller, which must guarantee that they remain valid until the handler is called. |
sender_endpoint | An endpoint object that receives the endpoint of the remote sender of the datagram. Ownership of the sender_endpoint object is retained by the caller, which must guarantee that it is valid until the handler is called. |
flags | Flags specifying how the receive call is to be made. |
handler | The handler to be called when the receive operation completes. Copies will be made of the handler as required. The function signature of the handler must be: void handler( std::size_t bytes_transferred // Number of bytes received. ); |
|
inline |
Receive some data on a connected socket.
This function is used to receive data on the datagram socket. The function call will block until data has been received successfully or an error occurs.
buffers | One or more buffers into which the data will be received. |
asio::system_error | Thrown on failure. |
|
inline |
Receive some data on a connected socket.
This function is used to receive data on the datagram socket. The function call will block until data has been received successfully or an error occurs.
buffers | One or more buffers into which the data will be received. |
flags | Flags specifying how the receive call is to be made. |
asio::system_error | Thrown on failure. |
|
inline |
Receive some data on a connected socket.
This function is used to receive data on the datagram socket. The function call will block until data has been received successfully or an error occurs.
buffers | One or more buffers into which the data will be received. |
flags | Flags specifying how the receive call is to be made. |
ec | Set to indicate what error occurred, if any. |
|
inline |
Receive a datagram with the endpoint of the sender.
This function is used to receive a datagram. The function call will block until data has been received successfully or an error occurs.
buffers | One or more buffers into which the data will be received. |
sender_endpoint | An endpoint object that receives the endpoint of the remote sender of the datagram. |
asio::system_error | Thrown on failure. |
|
inline |
Receive a datagram with the endpoint of the sender.
This function is used to receive a datagram. The function call will block until data has been received successfully or an error occurs.
buffers | One or more buffers into which the data will be received. |
sender_endpoint | An endpoint object that receives the endpoint of the remote sender of the datagram. |
flags | Flags specifying how the receive call is to be made. |
asio::system_error | Thrown on failure. |
|
inline |
Receive a datagram with the endpoint of the sender.
This function is used to receive a datagram. The function call will block until data has been received successfully or an error occurs.
buffers | One or more buffers into which the data will be received. |
sender_endpoint | An endpoint object that receives the endpoint of the remote sender of the datagram. |
flags | Flags specifying how the receive call is to be made. |
ec | Set to indicate what error occurred, if any. |
|
inline |
Send some data on a connected socket.
This function is used to send data on the datagram socket. The function call will block until the data has been sent successfully or an error occurs.
buffers | One ore more data buffers to be sent on the socket. |
asio::system_error | Thrown on failure. |
|
inline |
Send some data on a connected socket.
This function is used to send data on the datagram socket. The function call will block until the data has been sent successfully or an error occurs.
buffers | One ore more data buffers to be sent on the socket. |
flags | Flags specifying how the send call is to be made. |
asio::system_error | Thrown on failure. |
|
inline |
Send some data on a connected socket.
This function is used to send data on the datagram socket. The function call will block until the data has been sent successfully or an error occurs.
buffers | One or more data buffers to be sent on the socket. |
flags | Flags specifying how the send call is to be made. |
ec | Set to indicate what error occurred, if any. |
|
inline |
Send a datagram to the specified endpoint.
This function is used to send a datagram to the specified remote endpoint. The function call will block until the data has been sent successfully or an error occurs.
buffers | One or more data buffers to be sent to the remote endpoint. |
destination | The remote endpoint to which the data will be sent. |
asio::system_error | Thrown on failure. |
|
inline |
Send a datagram to the specified endpoint.
This function is used to send a datagram to the specified remote endpoint. The function call will block until the data has been sent successfully or an error occurs.
buffers | One or more data buffers to be sent to the remote endpoint. |
destination | The remote endpoint to which the data will be sent. |
flags | Flags specifying how the send call is to be made. |
asio::system_error | Thrown on failure. |
|
inline |
Send a datagram to the specified endpoint.
This function is used to send a datagram to the specified remote endpoint. The function call will block until the data has been sent successfully or an error occurs.
buffers | One or more data buffers to be sent to the remote endpoint. |
destination | The remote endpoint to which the data will be sent. |
flags | Flags specifying how the send call is to be made. |
ec | Set to indicate what error occurred, if any. |