asio 0.3.8rc3 Home | Reference | Tutorial | Examples | Design
Reference Class Hierarchy | Class Index | Member Index

asio::datagram_socket_service< Protocol > Class Template Reference

Inherits asio::io_service::service.

Inheritance diagram for asio::datagram_socket_service< Protocol >:

Inheritance graph
List of all members.

Detailed Description

template<typename Protocol>
class asio::datagram_socket_service< Protocol >

Default service implementation for a datagram socket.


Public Types

typedef Protocol protocol_type
 The protocol type.
typedef Protocol::endpoint endpoint_type
 The endpoint type.
typedef implementation_defined implementation_type
 The type of a datagram socket.
typedef implementation_defined native_type
 The native socket type.

Public Member Functions

 datagram_socket_service (asio::io_service &io_service)
 Construct a new datagram socket service for the specified io_service.
void shutdown_service ()
 Destroy all user-defined handler objects owned by the service.
void construct (implementation_type &impl)
 Construct a new datagram socket implementation.
void destroy (implementation_type &impl)
 Destroy a datagram socket implementation.
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.
bool is_open (const implementation_type &impl) const
 Determine whether the socket is open.
asio::error_code close (implementation_type &impl, asio::error_code &ec)
 Close a datagram socket implementation.
native_type native (implementation_type &impl)
 Get the native socket implementation.
asio::error_code cancel (implementation_type &impl, asio::error_code &ec)
 Cancel all asynchronous operations associated with the socket.
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 connect (implementation_type &impl, const endpoint_type &peer_endpoint, asio::error_code &ec)
 Connect the datagram socket to the specified endpoint.
template<typename ConnectHandler>
void async_connect (implementation_type &impl, const endpoint_type &peer_endpoint, ConnectHandler handler)
 Start an asynchronous connect.
template<typename SettableSocketOption>
asio::error_code set_option (implementation_type &impl, const SettableSocketOption &option, asio::error_code &ec)
 Set a socket option.
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.
endpoint_type local_endpoint (const implementation_type &impl, asio::error_code &ec) const
 Get the local endpoint.
endpoint_type remote_endpoint (const implementation_type &impl, asio::error_code &ec) const
 Get the remote endpoint.
asio::error_code shutdown (implementation_type &impl, socket_base::shutdown_type what, asio::error_code &ec)
 Disable sends or receives on the socket.
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, 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>
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 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.
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, 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>
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.
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.
asio::io_serviceio_service ()
 Get the io_service object that owns the service.

Static Public Attributes

static asio::io_service::id id
 The unique service identifier.


Member Typedef Documentation

template<typename Protocol>
typedef Protocol asio::datagram_socket_service< Protocol >::protocol_type

The protocol type.

template<typename Protocol>
typedef Protocol::endpoint asio::datagram_socket_service< Protocol >::endpoint_type

The endpoint type.

template<typename Protocol>
typedef implementation_defined asio::datagram_socket_service< Protocol >::implementation_type

The type of a datagram socket.

template<typename Protocol>
typedef implementation_defined asio::datagram_socket_service< Protocol >::native_type

The native socket type.


Constructor & Destructor Documentation

template<typename Protocol>
asio::datagram_socket_service< Protocol >::datagram_socket_service ( asio::io_service io_service  )  [explicit]

Construct a new datagram socket service for the specified io_service.


Member Function Documentation

template<typename Protocol>
void asio::datagram_socket_service< Protocol >::shutdown_service (  )  [virtual]

Destroy all user-defined handler objects owned by the service.

Implements asio::io_service::service.

template<typename Protocol>
void asio::datagram_socket_service< Protocol >::construct ( implementation_type impl  ) 

Construct a new datagram socket implementation.

template<typename Protocol>
void asio::datagram_socket_service< Protocol >::destroy ( implementation_type impl  ) 

Destroy a datagram socket implementation.

template<typename Protocol>
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 
)

Assign an existing native socket to a datagram socket.

template<typename Protocol>
bool asio::datagram_socket_service< Protocol >::is_open ( const implementation_type impl  )  const

Determine whether the socket is open.

template<typename Protocol>
asio::error_code asio::datagram_socket_service< Protocol >::close ( implementation_type impl,
asio::error_code ec 
)

Close a datagram socket implementation.

template<typename Protocol>
native_type asio::datagram_socket_service< Protocol >::native ( implementation_type impl  ) 

Get the native socket implementation.

template<typename Protocol>
asio::error_code asio::datagram_socket_service< Protocol >::cancel ( implementation_type impl,
asio::error_code ec 
)

Cancel all asynchronous operations associated with the socket.

template<typename Protocol>
bool asio::datagram_socket_service< Protocol >::at_mark ( const implementation_type impl,
asio::error_code ec 
) const

Determine whether the socket is at the out-of-band data mark.

template<typename Protocol>
std::size_t asio::datagram_socket_service< Protocol >::available ( const implementation_type impl,
asio::error_code ec 
) const

Determine the number of bytes available for reading.

template<typename Protocol>
asio::error_code asio::datagram_socket_service< Protocol >::connect ( implementation_type impl,
const endpoint_type peer_endpoint,
asio::error_code ec 
)

Connect the datagram socket to the specified endpoint.

template<typename Protocol>
template<typename ConnectHandler>
void asio::datagram_socket_service< Protocol >::async_connect ( implementation_type impl,
const endpoint_type peer_endpoint,
ConnectHandler  handler 
)

Start an asynchronous connect.

template<typename Protocol>
template<typename SettableSocketOption>
asio::error_code asio::datagram_socket_service< Protocol >::set_option ( implementation_type impl,
const SettableSocketOption &  option,
asio::error_code ec 
)

Set a socket option.

template<typename Protocol>
template<typename GettableSocketOption>
asio::error_code asio::datagram_socket_service< Protocol >::get_option ( const implementation_type impl,
GettableSocketOption &  option,
asio::error_code ec 
) const

Get a socket option.

template<typename Protocol>
template<typename IoControlCommand>
asio::error_code asio::datagram_socket_service< Protocol >::io_control ( implementation_type impl,
IoControlCommand &  command,
asio::error_code ec 
)

Perform an IO control command on the socket.

template<typename Protocol>
endpoint_type asio::datagram_socket_service< Protocol >::local_endpoint ( const implementation_type impl,
asio::error_code ec 
) const

Get the local endpoint.

template<typename Protocol>
endpoint_type asio::datagram_socket_service< Protocol >::remote_endpoint ( const implementation_type impl,
asio::error_code ec 
) const

Get the remote endpoint.

template<typename Protocol>
asio::error_code asio::datagram_socket_service< Protocol >::shutdown ( implementation_type impl,
socket_base::shutdown_type  what,
asio::error_code ec 
)

Disable sends or receives on the socket.

template<typename Protocol>
template<typename ConstBufferSequence>
std::size_t asio::datagram_socket_service< Protocol >::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 Protocol>
template<typename ConstBufferSequence, typename WriteHandler>
void asio::datagram_socket_service< Protocol >::async_send ( implementation_type impl,
const ConstBufferSequence &  buffers,
socket_base::message_flags  flags,
WriteHandler  handler 
)

Start an asynchronous send.

template<typename Protocol>
template<typename ConstBufferSequence>
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 
)

Send a datagram to the specified endpoint.

template<typename Protocol>
template<typename ConstBufferSequence, typename WriteHandler>
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 
)

Start an asynchronous send.

template<typename Protocol>
template<typename MutableBufferSequence>
std::size_t asio::datagram_socket_service< Protocol >::receive ( implementation_type impl,
const MutableBufferSequence &  buffers,
socket_base::message_flags  flags,
asio::error_code ec 
)

Receive some data from the peer.

template<typename Protocol>
template<typename MutableBufferSequence, typename ReadHandler>
void asio::datagram_socket_service< Protocol >::async_receive ( implementation_type impl,
const MutableBufferSequence &  buffers,
socket_base::message_flags  flags,
ReadHandler  handler 
)

Start an asynchronous receive.

template<typename Protocol>
template<typename MutableBufferSequence>
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 
)

Receive a datagram with the endpoint of the sender.

template<typename Protocol>
template<typename MutableBufferSequence, typename ReadHandler>
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 
)

Start an asynchronous receive that will get the endpoint of the sender.

asio::io_service & asio::io_service::service::io_service (  )  [inherited]

Get the io_service object that owns the service.


Member Data Documentation

template<typename Protocol>
asio::io_service::id asio::datagram_socket_service< Protocol >::id [static]

The unique service identifier.

asio 0.3.8rc3 Home | Reference | Tutorial | Examples | Design