Boost C++ Libraries Home Libraries People FAQ More

Home | Reference | Tutorial | Examples | Design
Reference Index | Class Hierarchy | Class Index | Member Index

boost::asio::datagram_socket_service< Protocol > Class Template Reference

Inherits boost::asio::io_service::service.

Inheritance diagram for boost::asio::datagram_socket_service< Protocol >:

Inheritance graph
List of all members.

Detailed Description

template<typename Protocol>
class boost::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 (boost::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.
template<typename Error_Handler>
void assign (implementation_type &impl, const protocol_type &protocol, const native_type &native_socket, Error_Handler error_handler)
 Assign an existing native socket to a datagram socket.
template<typename Error_Handler>
void close (implementation_type &impl, Error_Handler error_handler)
 Close a datagram socket implementation.
native_type native (implementation_type &impl)
 Get the native socket implementation.
template<typename Error_Handler>
void connect (implementation_type &impl, const endpoint_type &peer_endpoint, Error_Handler error_handler)
 Connect the datagram socket to the specified endpoint.
template<typename Handler>
void async_connect (implementation_type &impl, const endpoint_type &peer_endpoint, Handler handler)
 Start an asynchronous connect.
template<typename Option, typename Error_Handler>
void set_option (implementation_type &impl, const Option &option, Error_Handler error_handler)
 Set a socket option.
template<typename Option, typename Error_Handler>
void get_option (const implementation_type &impl, Option &option, Error_Handler error_handler) const
 Get a socket option.
template<typename IO_Control_Command, typename Error_Handler>
void io_control (implementation_type &impl, IO_Control_Command &command, Error_Handler error_handler)
 Perform an IO control command on the socket.
template<typename Error_Handler>
endpoint_type local_endpoint (const implementation_type &impl, Error_Handler error_handler) const
 Get the local endpoint.
template<typename Error_Handler>
endpoint_type remote_endpoint (const implementation_type &impl, Error_Handler error_handler) const
 Get the remote endpoint.
template<typename Error_Handler>
void shutdown (implementation_type &impl, socket_base::shutdown_type what, Error_Handler error_handler)
 Disable sends or receives on the socket.
template<typename Const_Buffers, typename Error_Handler>
std::size_t send (implementation_type &impl, const Const_Buffers &buffers, socket_base::message_flags flags, Error_Handler error_handler)
 Send the given data to the peer.
template<typename Const_Buffers, typename Handler>
void async_send (implementation_type &impl, const Const_Buffers &buffers, socket_base::message_flags flags, Handler handler)
 Start an asynchronous send.
template<typename Const_Buffers, typename Error_Handler>
std::size_t send_to (implementation_type &impl, const Const_Buffers &buffers, const endpoint_type &destination, socket_base::message_flags flags, Error_Handler error_handler)
 Send a datagram to the specified endpoint.
template<typename Const_Buffers, typename Handler>
void async_send_to (implementation_type &impl, const Const_Buffers &buffers, const endpoint_type &destination, socket_base::message_flags flags, Handler handler)
 Start an asynchronous send.
template<typename Mutable_Buffers, typename Error_Handler>
std::size_t receive (implementation_type &impl, const Mutable_Buffers &buffers, socket_base::message_flags flags, Error_Handler error_handler)
 Receive some data from the peer.
template<typename Mutable_Buffers, typename Handler>
void async_receive (implementation_type &impl, const Mutable_Buffers &buffers, socket_base::message_flags flags, Handler handler)
 Start an asynchronous receive.
template<typename Mutable_Buffers, typename Error_Handler>
std::size_t receive_from (implementation_type &impl, const Mutable_Buffers &buffers, endpoint_type &sender_endpoint, socket_base::message_flags flags, Error_Handler error_handler)
 Receive a datagram with the endpoint of the sender.
template<typename Mutable_Buffers, typename Handler>
void async_receive_from (implementation_type &impl, const Mutable_Buffers &buffers, endpoint_type &sender_endpoint, socket_base::message_flags flags, Handler handler)
 Start an asynchronous receive that will get the endpoint of the sender.
io_serviceowner ()
 Get the io_service object that owns the service.


Member Typedef Documentation

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

The protocol type.

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

The endpoint type.

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

The type of a datagram socket.

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

The native socket type.


Constructor & Destructor Documentation

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

Construct a new datagram socket service for the specified io_service.


Member Function Documentation

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

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

Implements boost::asio::io_service::service.

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

Construct a new datagram socket implementation.

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

Destroy a datagram socket implementation.

template<typename Protocol>
template<typename Error_Handler>
void boost::asio::datagram_socket_service< Protocol >::assign ( implementation_type impl,
const protocol_type protocol,
const native_type native_socket,
Error_Handler  error_handler 
)

Assign an existing native socket to a datagram socket.

template<typename Protocol>
template<typename Error_Handler>
void boost::asio::datagram_socket_service< Protocol >::close ( implementation_type impl,
Error_Handler  error_handler 
)

Close a datagram socket implementation.

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

Get the native socket implementation.

template<typename Protocol>
template<typename Error_Handler>
void boost::asio::datagram_socket_service< Protocol >::connect ( implementation_type impl,
const endpoint_type peer_endpoint,
Error_Handler  error_handler 
)

Connect the datagram socket to the specified endpoint.

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

Start an asynchronous connect.

template<typename Protocol>
template<typename Option, typename Error_Handler>
void boost::asio::datagram_socket_service< Protocol >::set_option ( implementation_type impl,
const Option &  option,
Error_Handler  error_handler 
)

Set a socket option.

template<typename Protocol>
template<typename Option, typename Error_Handler>
void boost::asio::datagram_socket_service< Protocol >::get_option ( const implementation_type impl,
Option &  option,
Error_Handler  error_handler 
) const

Get a socket option.

template<typename Protocol>
template<typename IO_Control_Command, typename Error_Handler>
void boost::asio::datagram_socket_service< Protocol >::io_control ( implementation_type impl,
IO_Control_Command command,
Error_Handler  error_handler 
)

Perform an IO control command on the socket.

template<typename Protocol>
template<typename Error_Handler>
endpoint_type boost::asio::datagram_socket_service< Protocol >::local_endpoint ( const implementation_type impl,
Error_Handler  error_handler 
) const

Get the local endpoint.

template<typename Protocol>
template<typename Error_Handler>
endpoint_type boost::asio::datagram_socket_service< Protocol >::remote_endpoint ( const implementation_type impl,
Error_Handler  error_handler 
) const

Get the remote endpoint.

template<typename Protocol>
template<typename Error_Handler>
void boost::asio::datagram_socket_service< Protocol >::shutdown ( implementation_type impl,
socket_base::shutdown_type  what,
Error_Handler  error_handler 
)

Disable sends or receives on the socket.

template<typename Protocol>
template<typename Const_Buffers, typename Error_Handler>
std::size_t boost::asio::datagram_socket_service< Protocol >::send ( implementation_type impl,
const Const_Buffers buffers,
socket_base::message_flags  flags,
Error_Handler  error_handler 
)

Send the given data to the peer.

template<typename Protocol>
template<typename Const_Buffers, typename Handler>
void boost::asio::datagram_socket_service< Protocol >::async_send ( implementation_type impl,
const Const_Buffers buffers,
socket_base::message_flags  flags,
Handler  handler 
)

Start an asynchronous send.

template<typename Protocol>
template<typename Const_Buffers, typename Error_Handler>
std::size_t boost::asio::datagram_socket_service< Protocol >::send_to ( implementation_type impl,
const Const_Buffers buffers,
const endpoint_type destination,
socket_base::message_flags  flags,
Error_Handler  error_handler 
)

Send a datagram to the specified endpoint.

template<typename Protocol>
template<typename Const_Buffers, typename Handler>
void boost::asio::datagram_socket_service< Protocol >::async_send_to ( implementation_type impl,
const Const_Buffers buffers,
const endpoint_type destination,
socket_base::message_flags  flags,
Handler  handler 
)

Start an asynchronous send.

template<typename Protocol>
template<typename Mutable_Buffers, typename Error_Handler>
std::size_t boost::asio::datagram_socket_service< Protocol >::receive ( implementation_type impl,
const Mutable_Buffers buffers,
socket_base::message_flags  flags,
Error_Handler  error_handler 
)

Receive some data from the peer.

template<typename Protocol>
template<typename Mutable_Buffers, typename Handler>
void boost::asio::datagram_socket_service< Protocol >::async_receive ( implementation_type impl,
const Mutable_Buffers buffers,
socket_base::message_flags  flags,
Handler  handler 
)

Start an asynchronous receive.

template<typename Protocol>
template<typename Mutable_Buffers, typename Error_Handler>
std::size_t boost::asio::datagram_socket_service< Protocol >::receive_from ( implementation_type impl,
const Mutable_Buffers buffers,
endpoint_type sender_endpoint,
socket_base::message_flags  flags,
Error_Handler  error_handler 
)

Receive a datagram with the endpoint of the sender.

template<typename Protocol>
template<typename Mutable_Buffers, typename Handler>
void boost::asio::datagram_socket_service< Protocol >::async_receive_from ( implementation_type impl,
const Mutable_Buffers buffers,
endpoint_type sender_endpoint,
socket_base::message_flags  flags,
Handler  handler 
)

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

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

Get the io_service object that owns the service.

Copyright © 2003 - 2006 Christopher M. Kohlhoff


Home | Reference | Tutorial | Examples | Design