asio 0.1.5 | Main Page | Class Index | Member Index | Tutorial |
Public Types | |
typedef Service | service_type |
The type of the service that will be used to provide socket operations. | |
typedef service_type::impl_type | impl_type |
The native implementation type of the dgram socket. | |
typedef service_type::demuxer_type | demuxer_type |
The demuxer type for this asynchronous type. | |
Public Member Functions | |
basic_dgram_socket (demuxer_type &d) | |
Construct a basic_dgram_socket without opening it. | |
template<typename Address> | basic_dgram_socket (demuxer_type &d, const Address &address) |
Construct a basic_dgram_socket, opening it and binding it to the given local address. | |
~basic_dgram_socket () | |
Destructor. | |
demuxer_type & | demuxer () |
Get the demuxer associated with the asynchronous object. | |
template<typename Protocol> void | open (const Protocol &protocol) |
Open the socket using the specified protocol. | |
template<typename Protocol, typename Error_Handler> void | open (const Protocol &protocol, Error_Handler error_handler) |
Open the socket using the specified protocol. | |
template<typename Address> void | bind (const Address &address) |
Bind the socket to the given local address. | |
template<typename Address, typename Error_Handler> void | bind (const Address &address, Error_Handler error_handler) |
Bind the socket to the given local address. | |
void | close () |
Close the socket. | |
impl_type | impl () |
Get the underlying implementation in the native type. | |
template<typename Option> void | set_option (const Option &option) |
Set an option on the socket. | |
template<typename Option, typename Error_Handler> void | set_option (const Option &option, Error_Handler error_handler) |
Set an option on the socket. | |
template<typename Option> void | get_option (Option &option) |
Get an option from the socket. | |
template<typename Option, typename Error_Handler> void | get_option (Option &option, Error_Handler error_handler) |
Get an option from the socket. | |
template<typename Address> void | get_local_address (Address &address) |
Get the local address of the socket. | |
template<typename Address, typename Error_Handler> void | get_local_address (Address &address, Error_Handler error_handler) |
Get the local address of the socket. | |
template<typename Address> size_t | sendto (const void *data, size_t length, const Address &destination) |
Send a datagram to the specified address. | |
template<typename Address, typename Error_Handler> size_t | sendto (const void *data, size_t length, const Address &destination, Error_Handler error_handler) |
Send a datagram to the specified address. | |
template<typename Address, typename Handler> void | async_sendto (const void *data, size_t length, const Address &destination, Handler handler) |
Start an asynchronous send. | |
template<typename Address, typename Handler, typename Completion_Context> void | async_sendto (const void *data, size_t length, const Address &destination, Handler handler, Completion_Context context) |
Start an asynchronous send. | |
template<typename Address> size_t | recvfrom (void *data, size_t max_length, Address &sender_address) |
Receive a datagram with the address of the sender. | |
template<typename Address, typename Error_Handler> size_t | recvfrom (void *data, size_t max_length, Address &sender_address, Error_Handler error_handler) |
Receive a datagram with the address of the sender. | |
template<typename Address, typename Handler> void | async_recvfrom (void *data, size_t max_length, Address &sender_address, Handler handler) |
Start an asynchronous receive. | |
template<typename Address, typename Handler, typename Completion_Context> void | async_recvfrom (void *data, size_t max_length, Address &sender_address, Handler handler, Completion_Context context) |
Start an asynchronous receive. | |
Private Attributes | |
service_type & | service_ |
The backend service implementation. | |
impl_type | impl_ |
The underlying native implementation. |
|
The type of the service that will be used to provide socket operations.
|
|
The native implementation type of the dgram socket.
|
|
The demuxer type for this asynchronous type.
|
|
Construct a basic_dgram_socket without opening it. This constructor creates a dgram socket without opening it. The open() function must be called before data can be sent or received on the socket.
|
|
Construct a basic_dgram_socket, opening it and binding it to the given local address. This constructor creates a dgram socket and automatically opens it bound to the specified address on the local machine. The protocol is determined automatically to be the default datagram protocol associated with the given address type.
|
|
Destructor.
|
|
Get the demuxer associated with the asynchronous object. This function may be used to obtain the demuxer object that the dgram socket uses to deliver completions for asynchronous operations.
|
|
Open the socket using the specified protocol. This function opens the dgram socket so that it will use the specified protocol.
|
|
Open the socket using the specified protocol. This function opens the dgram socket so that it will use the specified protocol.
|
|
Bind the socket to the given local address. This function binds the dgram socket to the specified address on the local machine.
|
|
Bind the socket to the given local address. This function binds the dgram socket to the specified address on the local machine.
|
|
Close the socket. This function is used to close the dgram socket. Any asynchronous sendto or recvfrom operations will be cancelled immediately. A subsequent call to open() is required before the socket can again be used to again perform send and receive operations. |
|
Get the underlying implementation in the native type. This function may be used to obtain the underlying implementation of the dgram socket. This is intended to allow access to native socket functionality that is not otherwise provided. |
|
Set an option on the socket. This function is used to set an option on the socket.
|
|
Set an option on the socket. This function is used to set an option on the socket.
|
|
Get an option from the socket. This function is used to get the current value of an option on the socket.
|
|
Get an option from the socket. This function is used to get the current value of an option on the socket.
|
|
Get the local address of the socket. This function is used to obtain the locally bound address of the socket.
|
|
Get the local address of the socket. This function is used to obtain the locally bound address of the socket.
|
|
Send a datagram to the specified address. This function is used to send a datagram to the specified remote address. The function call will block until the data has been sent successfully or an error occurs.
|
|
Send a datagram to the specified address. This function is used to send a datagram to the specified remote address. The function call will block until the data has been sent successfully or an error occurs.
|
|
Start an asynchronous send. This function is used to asynchronously send a datagram to the specified remote address. The function call always returns immediately.
|
|
Start an asynchronous send. This function is used to asynchronously send a datagram to the specified remote address. The function call always returns immediately.
|
|
Receive a datagram with the address 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.
|
|
Receive a datagram with the address 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.
|
|
Start an asynchronous receive. This function is used to asynchronously receive a datagram. The function call always returns immediately.
|
|
Start an asynchronous receive. This function is used to asynchronously receive a datagram. The function call always returns immediately.
|
|
The backend service implementation.
|
|
The underlying native implementation.
|