$search
Default service implementation for a datagram socket. More...
#include <datagram_socket_service.hpp>
Public Types | |
typedef Protocol::endpoint | endpoint_type |
The endpoint type. | |
typedef service_impl_type::implementation_type | implementation_type |
The type of a datagram socket. | |
typedef service_impl_type::native_type | native_type |
The native socket type. | |
typedef Protocol | protocol_type |
The protocol type. | |
Public Member Functions | |
asio::error_code | assign (implementation_type &impl, const protocol_type &protocol, const native_type &native_socket, asio::error_code &ec) |
Assign an existing native socket to a datagram socket. | |
template<typename ConnectHandler > | |
void | async_connect (implementation_type &impl, const endpoint_type &peer_endpoint, ConnectHandler handler) |
Start an asynchronous connect. | |
template<typename MutableBufferSequence , typename ReadHandler > | |
void | async_receive (implementation_type &impl, const MutableBufferSequence &buffers, socket_base::message_flags flags, ReadHandler handler) |
Start an asynchronous receive. | |
template<typename MutableBufferSequence , typename ReadHandler > | |
void | async_receive_from (implementation_type &impl, const MutableBufferSequence &buffers, endpoint_type &sender_endpoint, socket_base::message_flags flags, ReadHandler handler) |
Start an asynchronous receive that will get the endpoint of the sender. | |
template<typename ConstBufferSequence , typename WriteHandler > | |
void | async_send (implementation_type &impl, const ConstBufferSequence &buffers, socket_base::message_flags flags, WriteHandler handler) |
Start an asynchronous send. | |
template<typename ConstBufferSequence , typename WriteHandler > | |
void | async_send_to (implementation_type &impl, const ConstBufferSequence &buffers, const endpoint_type &destination, socket_base::message_flags flags, WriteHandler handler) |
Start an asynchronous send. | |
bool | at_mark (const implementation_type &impl, asio::error_code &ec) const |
Determine whether the socket is at the out-of-band data mark. | |
std::size_t | available (const implementation_type &impl, asio::error_code &ec) const |
Determine the number of bytes available for reading. | |
asio::error_code | bind (implementation_type &impl, const endpoint_type &endpoint, asio::error_code &ec) |
asio::error_code | cancel (implementation_type &impl, asio::error_code &ec) |
Cancel all asynchronous operations associated with the socket. | |
asio::error_code | close (implementation_type &impl, asio::error_code &ec) |
Close a datagram socket implementation. | |
asio::error_code | connect (implementation_type &impl, const endpoint_type &peer_endpoint, asio::error_code &ec) |
Connect the datagram socket to the specified endpoint. | |
void | construct (implementation_type &impl) |
Construct a new datagram socket implementation. | |
datagram_socket_service (asio::io_service &io_service) | |
Construct a new datagram socket service for the specified io_service. | |
void | destroy (implementation_type &impl) |
Destroy a datagram socket implementation. | |
template<typename GettableSocketOption > | |
asio::error_code | get_option (const implementation_type &impl, GettableSocketOption &option, asio::error_code &ec) const |
Get a socket option. | |
template<typename IoControlCommand > | |
asio::error_code | io_control (implementation_type &impl, IoControlCommand &command, asio::error_code &ec) |
Perform an IO control command on the socket. | |
bool | is_open (const implementation_type &impl) const |
Determine whether the socket is open. | |
endpoint_type | local_endpoint (const implementation_type &impl, asio::error_code &ec) const |
Get the local endpoint. | |
native_type | native (implementation_type &impl) |
Get the native socket implementation. | |
asio::error_code | open (implementation_type &impl, const protocol_type &protocol, asio::error_code &ec) |
template<typename MutableBufferSequence > | |
std::size_t | receive (implementation_type &impl, const MutableBufferSequence &buffers, socket_base::message_flags flags, asio::error_code &ec) |
Receive some data from the peer. | |
template<typename MutableBufferSequence > | |
std::size_t | receive_from (implementation_type &impl, 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. | |
endpoint_type | remote_endpoint (const implementation_type &impl, asio::error_code &ec) const |
Get the remote endpoint. | |
template<typename ConstBufferSequence > | |
std::size_t | send (implementation_type &impl, const ConstBufferSequence &buffers, socket_base::message_flags flags, asio::error_code &ec) |
Send the given data to the peer. | |
template<typename ConstBufferSequence > | |
std::size_t | send_to (implementation_type &impl, const ConstBufferSequence &buffers, const endpoint_type &destination, socket_base::message_flags flags, asio::error_code &ec) |
Send a datagram to the specified endpoint. | |
template<typename SettableSocketOption > | |
asio::error_code | set_option (implementation_type &impl, const SettableSocketOption &option, asio::error_code &ec) |
Set a socket option. | |
asio::error_code | shutdown (implementation_type &impl, socket_base::shutdown_type what, asio::error_code &ec) |
Disable sends or receives on the socket. | |
void | shutdown_service () |
Destroy all user-defined handler objects owned by the service. | |
Private Types | |
typedef detail::reactive_socket_service < Protocol, detail::select_reactor< false > > | service_impl_type |
Private Attributes | |
service_impl_type & | service_impl_ |
Default service implementation for a datagram socket.
Definition at line 38 of file datagram_socket_service.hpp.
typedef Protocol::endpoint asio::datagram_socket_service< Protocol >::endpoint_type |
The endpoint type.
Definition at line 55 of file datagram_socket_service.hpp.
typedef service_impl_type::implementation_type asio::datagram_socket_service< Protocol >::implementation_type |
The type of a datagram socket.
Definition at line 80 of file datagram_socket_service.hpp.
typedef service_impl_type::native_type asio::datagram_socket_service< Protocol >::native_type |
The native socket type.
Definition at line 87 of file datagram_socket_service.hpp.
typedef Protocol asio::datagram_socket_service< Protocol >::protocol_type |
The protocol type.
Definition at line 52 of file datagram_socket_service.hpp.
typedef detail::reactive_socket_service< Protocol, detail::select_reactor<false> > asio::datagram_socket_service< Protocol >::service_impl_type [private] |
Definition at line 72 of file datagram_socket_service.hpp.
asio::datagram_socket_service< Protocol >::datagram_socket_service | ( | asio::io_service & | io_service | ) | [inline, explicit] |
Construct a new datagram socket service for the specified io_service.
Definition at line 91 of file datagram_socket_service.hpp.
asio::error_code asio::datagram_socket_service< Protocol >::assign | ( | implementation_type & | impl, | |
const protocol_type & | protocol, | |||
const native_type & | native_socket, | |||
asio::error_code & | ec | |||
) | [inline] |
Assign an existing native socket to a datagram socket.
Definition at line 127 of file datagram_socket_service.hpp.
void asio::datagram_socket_service< Protocol >::async_connect | ( | implementation_type & | impl, | |
const endpoint_type & | peer_endpoint, | |||
ConnectHandler | handler | |||
) | [inline] |
Start an asynchronous connect.
Definition at line 190 of file datagram_socket_service.hpp.
void asio::datagram_socket_service< Protocol >::async_receive | ( | implementation_type & | impl, | |
const MutableBufferSequence & | buffers, | |||
socket_base::message_flags | flags, | |||
ReadHandler | handler | |||
) | [inline] |
Start an asynchronous receive.
Definition at line 287 of file datagram_socket_service.hpp.
void asio::datagram_socket_service< Protocol >::async_receive_from | ( | implementation_type & | impl, | |
const MutableBufferSequence & | buffers, | |||
endpoint_type & | sender_endpoint, | |||
socket_base::message_flags | flags, | |||
ReadHandler | handler | |||
) | [inline] |
Start an asynchronous receive that will get the endpoint of the sender.
Definition at line 306 of file datagram_socket_service.hpp.
void asio::datagram_socket_service< Protocol >::async_send | ( | implementation_type & | impl, | |
const ConstBufferSequence & | buffers, | |||
socket_base::message_flags | flags, | |||
WriteHandler | handler | |||
) | [inline] |
Start an asynchronous send.
Definition at line 252 of file datagram_socket_service.hpp.
void asio::datagram_socket_service< Protocol >::async_send_to | ( | implementation_type & | impl, | |
const ConstBufferSequence & | buffers, | |||
const endpoint_type & | destination, | |||
socket_base::message_flags | flags, | |||
WriteHandler | handler | |||
) | [inline] |
Start an asynchronous send.
Definition at line 269 of file datagram_socket_service.hpp.
bool asio::datagram_socket_service< Protocol >::at_mark | ( | const implementation_type & | impl, | |
asio::error_code & | ec | |||
) | const [inline] |
Determine whether the socket is at the out-of-band data mark.
Definition at line 161 of file datagram_socket_service.hpp.
std::size_t asio::datagram_socket_service< Protocol >::available | ( | const implementation_type & | impl, | |
asio::error_code & | ec | |||
) | const [inline] |
Determine the number of bytes available for reading.
Definition at line 168 of file datagram_socket_service.hpp.
asio::error_code asio::datagram_socket_service< Protocol >::bind | ( | implementation_type & | impl, | |
const endpoint_type & | endpoint, | |||
asio::error_code & | ec | |||
) | [inline] |
Definition at line 175 of file datagram_socket_service.hpp.
asio::error_code asio::datagram_socket_service< Protocol >::cancel | ( | implementation_type & | impl, | |
asio::error_code & | ec | |||
) | [inline] |
Cancel all asynchronous operations associated with the socket.
Definition at line 154 of file datagram_socket_service.hpp.
asio::error_code asio::datagram_socket_service< Protocol >::close | ( | implementation_type & | impl, | |
asio::error_code & | ec | |||
) | [inline] |
Close a datagram socket implementation.
Definition at line 141 of file datagram_socket_service.hpp.
asio::error_code asio::datagram_socket_service< Protocol >::connect | ( | implementation_type & | impl, | |
const endpoint_type & | peer_endpoint, | |||
asio::error_code & | ec | |||
) | [inline] |
Connect the datagram socket to the specified endpoint.
Definition at line 182 of file datagram_socket_service.hpp.
void asio::datagram_socket_service< Protocol >::construct | ( | implementation_type & | impl | ) | [inline] |
Construct a new datagram socket implementation.
Definition at line 104 of file datagram_socket_service.hpp.
void asio::datagram_socket_service< Protocol >::destroy | ( | implementation_type & | impl | ) | [inline] |
Destroy a datagram socket implementation.
Definition at line 110 of file datagram_socket_service.hpp.
asio::error_code asio::datagram_socket_service< Protocol >::get_option | ( | const implementation_type & | impl, | |
GettableSocketOption & | option, | |||
asio::error_code & | ec | |||
) | const [inline] |
Get a socket option.
Definition at line 206 of file datagram_socket_service.hpp.
asio::error_code asio::datagram_socket_service< Protocol >::io_control | ( | implementation_type & | impl, | |
IoControlCommand & | command, | |||
asio::error_code & | ec | |||
) | [inline] |
Perform an IO control command on the socket.
Definition at line 214 of file datagram_socket_service.hpp.
bool asio::datagram_socket_service< Protocol >::is_open | ( | const implementation_type & | impl | ) | const [inline] |
Determine whether the socket is open.
Definition at line 135 of file datagram_socket_service.hpp.
endpoint_type asio::datagram_socket_service< Protocol >::local_endpoint | ( | const implementation_type & | impl, | |
asio::error_code & | ec | |||
) | const [inline] |
Get the local endpoint.
Definition at line 221 of file datagram_socket_service.hpp.
native_type asio::datagram_socket_service< Protocol >::native | ( | implementation_type & | impl | ) | [inline] |
Get the native socket implementation.
Definition at line 148 of file datagram_socket_service.hpp.
asio::error_code asio::datagram_socket_service< Protocol >::open | ( | implementation_type & | impl, | |
const protocol_type & | protocol, | |||
asio::error_code & | ec | |||
) | [inline] |
Definition at line 116 of file datagram_socket_service.hpp.
std::size_t asio::datagram_socket_service< Protocol >::receive | ( | implementation_type & | impl, | |
const MutableBufferSequence & | buffers, | |||
socket_base::message_flags | flags, | |||
asio::error_code & | ec | |||
) | [inline] |
Receive some data from the peer.
Definition at line 278 of file datagram_socket_service.hpp.
std::size_t asio::datagram_socket_service< Protocol >::receive_from | ( | implementation_type & | impl, | |
const MutableBufferSequence & | buffers, | |||
endpoint_type & | sender_endpoint, | |||
socket_base::message_flags | flags, | |||
asio::error_code & | ec | |||
) | [inline] |
Receive a datagram with the endpoint of the sender.
Definition at line 296 of file datagram_socket_service.hpp.
endpoint_type asio::datagram_socket_service< Protocol >::remote_endpoint | ( | const implementation_type & | impl, | |
asio::error_code & | ec | |||
) | const [inline] |
Get the remote endpoint.
Definition at line 228 of file datagram_socket_service.hpp.
std::size_t asio::datagram_socket_service< Protocol >::send | ( | implementation_type & | impl, | |
const ConstBufferSequence & | buffers, | |||
socket_base::message_flags | flags, | |||
asio::error_code & | ec | |||
) | [inline] |
Send the given data to the peer.
Definition at line 243 of file datagram_socket_service.hpp.
std::size_t asio::datagram_socket_service< Protocol >::send_to | ( | implementation_type & | impl, | |
const ConstBufferSequence & | buffers, | |||
const endpoint_type & | destination, | |||
socket_base::message_flags | flags, | |||
asio::error_code & | ec | |||
) | [inline] |
Send a datagram to the specified endpoint.
Definition at line 260 of file datagram_socket_service.hpp.
asio::error_code asio::datagram_socket_service< Protocol >::set_option | ( | implementation_type & | impl, | |
const SettableSocketOption & | option, | |||
asio::error_code & | ec | |||
) | [inline] |
Set a socket option.
Definition at line 198 of file datagram_socket_service.hpp.
asio::error_code asio::datagram_socket_service< Protocol >::shutdown | ( | implementation_type & | impl, | |
socket_base::shutdown_type | what, | |||
asio::error_code & | ec | |||
) | [inline] |
Disable sends or receives on the socket.
Definition at line 235 of file datagram_socket_service.hpp.
void asio::datagram_socket_service< Protocol >::shutdown_service | ( | ) | [inline, virtual] |
Destroy all user-defined handler objects owned by the service.
Implements asio::io_service::service.
Definition at line 99 of file datagram_socket_service.hpp.
service_impl_type& asio::datagram_socket_service< Protocol >::service_impl_ [private] |
Definition at line 316 of file datagram_socket_service.hpp.