All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions
asio::basic_raw_socket< Protocol, RawSocketService > Class Template Reference

Provides raw-oriented socket functionality. More...

#include <basic_raw_socket.hpp>

Inheritance diagram for asio::basic_raw_socket< Protocol, RawSocketService >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef Protocol::endpoint endpoint_type
 The endpoint type.
typedef
RawSocketService::native_type 
native_type
 The native representation of a socket.
typedef Protocol protocol_type
 The protocol type.

Public Member Functions

template<typename MutableBufferSequence , typename ReadHandler >
void async_receive (const MutableBufferSequence &buffers, ReadHandler handler)
 Start an asynchronous receive on a connected socket.
template<typename MutableBufferSequence , typename ReadHandler >
void async_receive (const MutableBufferSequence &buffers, socket_base::message_flags flags, ReadHandler handler)
 Start an asynchronous receive on a connected socket.
template<typename MutableBufferSequence , typename ReadHandler >
void async_receive_from (const MutableBufferSequence &buffers, endpoint_type &sender_endpoint, ReadHandler handler)
 Start an asynchronous receive.
template<typename MutableBufferSequence , typename ReadHandler >
void async_receive_from (const MutableBufferSequence &buffers, endpoint_type &sender_endpoint, socket_base::message_flags flags, ReadHandler handler)
 Start an asynchronous receive.
template<typename ConstBufferSequence , typename WriteHandler >
void async_send (const ConstBufferSequence &buffers, WriteHandler handler)
 Start an asynchronous send on a connected socket.
template<typename ConstBufferSequence , typename WriteHandler >
void async_send (const ConstBufferSequence &buffers, socket_base::message_flags flags, WriteHandler handler)
 Start an asynchronous send on a connected socket.
template<typename ConstBufferSequence , typename WriteHandler >
void async_send_to (const ConstBufferSequence &buffers, const endpoint_type &destination, WriteHandler handler)
 Start an asynchronous send.
template<typename ConstBufferSequence , typename WriteHandler >
void async_send_to (const ConstBufferSequence &buffers, const endpoint_type &destination, socket_base::message_flags flags, WriteHandler handler)
 Start an asynchronous send.
 basic_raw_socket (asio::io_service &io_service)
 Construct a basic_raw_socket without opening it.
 basic_raw_socket (asio::io_service &io_service, const protocol_type &protocol)
 Construct and open a basic_raw_socket.
 basic_raw_socket (asio::io_service &io_service, const endpoint_type &endpoint)
 basic_raw_socket (asio::io_service &io_service, const protocol_type &protocol, const native_type &native_socket)
 Construct a basic_raw_socket on an existing native socket.
template<typename MutableBufferSequence >
std::size_t receive (const MutableBufferSequence &buffers)
 Receive some data on a connected socket.
template<typename MutableBufferSequence >
std::size_t receive (const MutableBufferSequence &buffers, socket_base::message_flags flags)
 Receive some data on a connected socket.
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.
template<typename MutableBufferSequence >
std::size_t receive_from (const MutableBufferSequence &buffers, endpoint_type &sender_endpoint)
 Receive raw data with the endpoint of the sender.
template<typename MutableBufferSequence >
std::size_t receive_from (const MutableBufferSequence &buffers, endpoint_type &sender_endpoint, socket_base::message_flags flags)
 Receive raw data with the endpoint of the sender.
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 raw data with the endpoint of the sender.
template<typename ConstBufferSequence >
std::size_t send (const ConstBufferSequence &buffers)
 Send some data on a connected socket.
template<typename ConstBufferSequence >
std::size_t send (const ConstBufferSequence &buffers, socket_base::message_flags flags)
 Send some data on a connected socket.
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.
template<typename ConstBufferSequence >
std::size_t send_to (const ConstBufferSequence &buffers, const endpoint_type &destination)
 Send raw data to the specified endpoint.
template<typename ConstBufferSequence >
std::size_t send_to (const ConstBufferSequence &buffers, const endpoint_type &destination, socket_base::message_flags flags)
 Send raw data to the specified endpoint.
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 raw data to the specified endpoint.

Detailed Description

template<typename Protocol, typename RawSocketService = raw_socket_service<Protocol>>
class asio::basic_raw_socket< Protocol, RawSocketService >

Provides raw-oriented socket functionality.

The basic_raw_socket class template provides asynchronous and blocking raw-oriented socket functionality.

Thread Safety
Distinct objects: Safe.
Shared objects: Unsafe.

Definition at line 43 of file basic_raw_socket.hpp.


Member Typedef Documentation

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
typedef Protocol::endpoint asio::basic_raw_socket< Protocol, RawSocketService >::endpoint_type

The endpoint type.

Reimplemented from asio::basic_socket< Protocol, RawSocketService >.

Definition at line 54 of file basic_raw_socket.hpp.

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
typedef RawSocketService::native_type asio::basic_raw_socket< Protocol, RawSocketService >::native_type

The native representation of a socket.

Reimplemented from asio::basic_socket< Protocol, RawSocketService >.

Definition at line 48 of file basic_raw_socket.hpp.

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
typedef Protocol asio::basic_raw_socket< Protocol, RawSocketService >::protocol_type

The protocol type.

Reimplemented from asio::basic_socket< Protocol, RawSocketService >.

Definition at line 51 of file basic_raw_socket.hpp.


Constructor & Destructor Documentation

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
asio::basic_raw_socket< Protocol, RawSocketService >::basic_raw_socket ( asio::io_service io_service) [inline, explicit]

Construct a basic_raw_socket without opening it.

This constructor creates a raw socket without opening it. The open() function must be called before data can be sent or received on the socket.

Parameters:
io_serviceThe io_service object that the raw socket will use to dispatch handlers for any asynchronous operations performed on the socket.

Definition at line 65 of file basic_raw_socket.hpp.

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
asio::basic_raw_socket< Protocol, RawSocketService >::basic_raw_socket ( asio::io_service io_service,
const protocol_type protocol 
) [inline]

Construct and open a basic_raw_socket.

This constructor creates and opens a raw socket.

Parameters:
io_serviceThe io_service object that the raw socket will use to dispatch handlers for any asynchronous operations performed on the socket.
protocolAn object specifying protocol parameters to be used.
Exceptions:
asio::system_errorThrown on failure.

Definition at line 82 of file basic_raw_socket.hpp.

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
asio::basic_raw_socket< Protocol, RawSocketService >::basic_raw_socket ( asio::io_service io_service,
const endpoint_type endpoint 
) [inline]

Construct a basic_raw_socket, opening it and binding it to the given local endpoint. This constructor creates a raw 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.

Parameters:
io_serviceThe io_service object that the raw socket will use to dispatch handlers for any asynchronous operations performed on the socket.
endpointAn endpoint on the local machine to which the raw socket will be bound.
Exceptions:
asio::system_errorThrown on failure.

Definition at line 104 of file basic_raw_socket.hpp.

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
asio::basic_raw_socket< Protocol, RawSocketService >::basic_raw_socket ( asio::io_service io_service,
const protocol_type protocol,
const native_type native_socket 
) [inline]

Construct a basic_raw_socket on an existing native socket.

This constructor creates a raw socket object to hold an existing native socket.

Parameters:
io_serviceThe io_service object that the raw socket will use to dispatch handlers for any asynchronous operations performed on the socket.
protocolAn object specifying protocol parameters to be used.
native_socketThe new underlying socket implementation.
Exceptions:
asio::system_errorThrown on failure.

Definition at line 125 of file basic_raw_socket.hpp.


Member Function Documentation

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
template<typename MutableBufferSequence , typename ReadHandler >
void asio::basic_raw_socket< Protocol, RawSocketService >::async_receive ( const MutableBufferSequence &  buffers,
ReadHandler  handler 
) [inline]

Start an asynchronous receive on a connected socket.

This function is used to asynchronously receive data from the raw socket. The function call always returns immediately.

Parameters:
buffersOne 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.
handlerThe 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(
   const asio::error_code& error, // Result of operation.
   std::size_t bytes_transferred           // Number of bytes received.
 ); 
Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using asio::io_service::post().
Note:
The async_receive operation can only be used with a connected socket. Use the async_receive_from function to receive data on an unconnected raw socket.
Example
To receive into a single data buffer use the asio::buffer function as follows:
 socket.async_receive(asio::buffer(data, size), handler);
See the asio::buffer documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.

Definition at line 582 of file basic_raw_socket.hpp.

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
template<typename MutableBufferSequence , typename ReadHandler >
void asio::basic_raw_socket< Protocol, RawSocketService >::async_receive ( const MutableBufferSequence &  buffers,
socket_base::message_flags  flags,
ReadHandler  handler 
) [inline]

Start an asynchronous receive on a connected socket.

This function is used to asynchronously receive data from the raw socket. The function call always returns immediately.

Parameters:
buffersOne 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.
flagsFlags specifying how the receive call is to be made.
handlerThe 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(
   const asio::error_code& error, // Result of operation.
   std::size_t bytes_transferred           // Number of bytes received.
 ); 
Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using asio::io_service::post().
Note:
The async_receive operation can only be used with a connected socket. Use the async_receive_from function to receive data on an unconnected raw socket.

Definition at line 616 of file basic_raw_socket.hpp.

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
template<typename MutableBufferSequence , typename ReadHandler >
void asio::basic_raw_socket< Protocol, RawSocketService >::async_receive_from ( const MutableBufferSequence &  buffers,
endpoint_type sender_endpoint,
ReadHandler  handler 
) [inline]

Start an asynchronous receive.

This function is used to asynchronously receive raw data. The function call always returns immediately.

Parameters:
buffersOne 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_endpointAn endpoint object that receives the endpoint of the remote sender of the data. Ownership of the sender_endpoint object is retained by the caller, which must guarantee that it is valid until the handler is called.
handlerThe 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(
   const asio::error_code& error, // Result of operation.
   std::size_t bytes_transferred           // Number of bytes received.
 ); 
Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using asio::io_service::post().
Example
To receive into a single data buffer use the asio::buffer function as follows:
 socket.async_receive_from(
     asio::buffer(data, size), 0, sender_endpoint, handler); 
See the asio::buffer documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.

Definition at line 748 of file basic_raw_socket.hpp.

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
template<typename MutableBufferSequence , typename ReadHandler >
void asio::basic_raw_socket< Protocol, RawSocketService >::async_receive_from ( const MutableBufferSequence &  buffers,
endpoint_type sender_endpoint,
socket_base::message_flags  flags,
ReadHandler  handler 
) [inline]

Start an asynchronous receive.

This function is used to asynchronously receive raw data. The function call always returns immediately.

Parameters:
buffersOne 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_endpointAn endpoint object that receives the endpoint of the remote sender of the data. Ownership of the sender_endpoint object is retained by the caller, which must guarantee that it is valid until the handler is called.
flagsFlags specifying how the receive call is to be made.
handlerThe 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(
   const asio::error_code& error, // Result of operation.
   std::size_t bytes_transferred           // Number of bytes received.
 ); 
Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using asio::io_service::post().

Definition at line 785 of file basic_raw_socket.hpp.

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
template<typename ConstBufferSequence , typename WriteHandler >
void asio::basic_raw_socket< Protocol, RawSocketService >::async_send ( const ConstBufferSequence &  buffers,
WriteHandler  handler 
) [inline]

Start an asynchronous send on a connected socket.

This function is used to send data on the raw socket. The function call will block until the data has been sent successfully or an error occurs.

Parameters:
buffersOne 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.
handlerThe 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(
   const asio::error_code& error, // Result of operation.
   std::size_t bytes_transferred           // Number of bytes sent.
 ); 
Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using asio::io_service::post().
Note:
The async_send operation can only be used with a connected socket. Use the async_send_to function to send data on an unconnected raw socket.
Example
To send a single data buffer use the asio::buffer function as follows:
 socket.async_send(asio::buffer(data, size), handler);
See the asio::buffer documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.

Definition at line 248 of file basic_raw_socket.hpp.

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
template<typename ConstBufferSequence , typename WriteHandler >
void asio::basic_raw_socket< Protocol, RawSocketService >::async_send ( const ConstBufferSequence &  buffers,
socket_base::message_flags  flags,
WriteHandler  handler 
) [inline]

Start an asynchronous send on a connected socket.

This function is used to send data on the raw socket. The function call will block until the data has been sent successfully or an error occurs.

Parameters:
buffersOne 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.
flagsFlags specifying how the send call is to be made.
handlerThe 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(
   const asio::error_code& error, // Result of operation.
   std::size_t bytes_transferred           // Number of bytes sent.
 ); 
Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using asio::io_service::post().
Note:
The async_send operation can only be used with a connected socket. Use the async_send_to function to send data on an unconnected raw socket.

Definition at line 282 of file basic_raw_socket.hpp.

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
template<typename ConstBufferSequence , typename WriteHandler >
void asio::basic_raw_socket< Protocol, RawSocketService >::async_send_to ( const ConstBufferSequence &  buffers,
const endpoint_type destination,
WriteHandler  handler 
) [inline]

Start an asynchronous send.

This function is used to asynchronously send raw data to the specified remote endpoint. The function call always returns immediately.

Parameters:
buffersOne 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.
destinationThe remote endpoint to which the data will be sent. Copies will be made of the endpoint as required.
handlerThe 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(
   const asio::error_code& error, // Result of operation.
   std::size_t bytes_transferred           // Number of bytes sent.
 ); 
Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using asio::io_service::post().
Example
To send a single data buffer use the asio::buffer function as follows:
 asio::ip::udp::endpoint destination(
     asio::ip::address::from_string("1.2.3.4"), 12345);
 socket.async_send_to(
     asio::buffer(data, size), destination, handler);
See the asio::buffer documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.

Definition at line 414 of file basic_raw_socket.hpp.

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
template<typename ConstBufferSequence , typename WriteHandler >
void asio::basic_raw_socket< Protocol, RawSocketService >::async_send_to ( const ConstBufferSequence &  buffers,
const endpoint_type destination,
socket_base::message_flags  flags,
WriteHandler  handler 
) [inline]

Start an asynchronous send.

This function is used to asynchronously send raw data to the specified remote endpoint. The function call always returns immediately.

Parameters:
buffersOne 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.
flagsFlags specifying how the send call is to be made.
destinationThe remote endpoint to which the data will be sent. Copies will be made of the endpoint as required.
handlerThe 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(
   const asio::error_code& error, // Result of operation.
   std::size_t bytes_transferred           // Number of bytes sent.
 ); 
Regardless of whether the asynchronous operation completes immediately or not, the handler will not be invoked from within this function. Invocation of the handler will be performed in a manner equivalent to using asio::io_service::post().

Definition at line 449 of file basic_raw_socket.hpp.

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
template<typename MutableBufferSequence >
std::size_t asio::basic_raw_socket< Protocol, RawSocketService >::receive ( const MutableBufferSequence &  buffers) [inline]

Receive some data on a connected socket.

This function is used to receive data on the raw socket. The function call will block until data has been received successfully or an error occurs.

Parameters:
buffersOne or more buffers into which the data will be received.
Returns:
The number of bytes received.
Exceptions:
asio::system_errorThrown on failure.
Note:
The receive operation can only be used with a connected socket. Use the receive_from function to receive data on an unconnected raw socket.
Example
To receive into a single data buffer use the asio::buffer function as follows:
 socket.receive(asio::buffer(data, size)); 
See the asio::buffer documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.

Definition at line 482 of file basic_raw_socket.hpp.

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
template<typename MutableBufferSequence >
std::size_t asio::basic_raw_socket< Protocol, RawSocketService >::receive ( const MutableBufferSequence &  buffers,
socket_base::message_flags  flags 
) [inline]

Receive some data on a connected socket.

This function is used to receive data on the raw socket. The function call will block until data has been received successfully or an error occurs.

Parameters:
buffersOne or more buffers into which the data will be received.
flagsFlags specifying how the receive call is to be made.
Returns:
The number of bytes received.
Exceptions:
asio::system_errorThrown on failure.
Note:
The receive operation can only be used with a connected socket. Use the receive_from function to receive data on an unconnected raw socket.

Definition at line 510 of file basic_raw_socket.hpp.

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
template<typename MutableBufferSequence >
std::size_t asio::basic_raw_socket< Protocol, RawSocketService >::receive ( const MutableBufferSequence &  buffers,
socket_base::message_flags  flags,
asio::error_code ec 
) [inline]

Receive some data on a connected socket.

This function is used to receive data on the raw socket. The function call will block until data has been received successfully or an error occurs.

Parameters:
buffersOne or more buffers into which the data will be received.
flagsFlags specifying how the receive call is to be made.
ecSet to indicate what error occurred, if any.
Returns:
The number of bytes received.
Note:
The receive operation can only be used with a connected socket. Use the receive_from function to receive data on an unconnected raw socket.

Definition at line 539 of file basic_raw_socket.hpp.

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
template<typename MutableBufferSequence >
std::size_t asio::basic_raw_socket< Protocol, RawSocketService >::receive_from ( const MutableBufferSequence &  buffers,
endpoint_type sender_endpoint 
) [inline]

Receive raw data with the endpoint of the sender.

This function is used to receive raw data. The function call will block until data has been received successfully or an error occurs.

Parameters:
buffersOne or more buffers into which the data will be received.
sender_endpointAn endpoint object that receives the endpoint of the remote sender of the data.
Returns:
The number of bytes received.
Exceptions:
asio::system_errorThrown on failure.
Example
To receive into a single data buffer use the asio::buffer function as follows:
 asio::ip::udp::endpoint sender_endpoint;
 socket.receive_from(
     asio::buffer(data, size), sender_endpoint);
See the asio::buffer documentation for information on receiving into multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.

Definition at line 649 of file basic_raw_socket.hpp.

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
template<typename MutableBufferSequence >
std::size_t asio::basic_raw_socket< Protocol, RawSocketService >::receive_from ( const MutableBufferSequence &  buffers,
endpoint_type sender_endpoint,
socket_base::message_flags  flags 
) [inline]

Receive raw data with the endpoint of the sender.

This function is used to receive raw data. The function call will block until data has been received successfully or an error occurs.

Parameters:
buffersOne or more buffers into which the data will be received.
sender_endpointAn endpoint object that receives the endpoint of the remote sender of the data.
flagsFlags specifying how the receive call is to be made.
Returns:
The number of bytes received.
Exceptions:
asio::system_errorThrown on failure.

Definition at line 676 of file basic_raw_socket.hpp.

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
template<typename MutableBufferSequence >
std::size_t asio::basic_raw_socket< Protocol, RawSocketService >::receive_from ( const MutableBufferSequence &  buffers,
endpoint_type sender_endpoint,
socket_base::message_flags  flags,
asio::error_code ec 
) [inline]

Receive raw data with the endpoint of the sender.

This function is used to receive raw data. The function call will block until data has been received successfully or an error occurs.

Parameters:
buffersOne or more buffers into which the data will be received.
sender_endpointAn endpoint object that receives the endpoint of the remote sender of the data.
flagsFlags specifying how the receive call is to be made.
ecSet to indicate what error occurred, if any.
Returns:
The number of bytes received.

Definition at line 703 of file basic_raw_socket.hpp.

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
template<typename ConstBufferSequence >
std::size_t asio::basic_raw_socket< Protocol, RawSocketService >::send ( const ConstBufferSequence &  buffers) [inline]

Send some data on a connected socket.

This function is used to send data on the raw socket. The function call will block until the data has been sent successfully or an error occurs.

Parameters:
buffersOne ore more data buffers to be sent on the socket.
Returns:
The number of bytes sent.
Exceptions:
asio::system_errorThrown on failure.
Note:
The send operation can only be used with a connected socket. Use the send_to function to send data on an unconnected raw socket.
Example
To send a single data buffer use the asio::buffer function as follows:
 socket.send(asio::buffer(data, size)); 
See the asio::buffer documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.

Definition at line 154 of file basic_raw_socket.hpp.

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
template<typename ConstBufferSequence >
std::size_t asio::basic_raw_socket< Protocol, RawSocketService >::send ( const ConstBufferSequence &  buffers,
socket_base::message_flags  flags 
) [inline]

Send some data on a connected socket.

This function is used to send data on the raw socket. The function call will block until the data has been sent successfully or an error occurs.

Parameters:
buffersOne ore more data buffers to be sent on the socket.
flagsFlags specifying how the send call is to be made.
Returns:
The number of bytes sent.
Exceptions:
asio::system_errorThrown on failure.
Note:
The send operation can only be used with a connected socket. Use the send_to function to send data on an unconnected raw socket.

Definition at line 179 of file basic_raw_socket.hpp.

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
template<typename ConstBufferSequence >
std::size_t asio::basic_raw_socket< Protocol, RawSocketService >::send ( const ConstBufferSequence &  buffers,
socket_base::message_flags  flags,
asio::error_code ec 
) [inline]

Send some data on a connected socket.

This function is used to send data on the raw socket. The function call will block until the data has been sent successfully or an error occurs.

Parameters:
buffersOne or more data buffers to be sent on the socket.
flagsFlags specifying how the send call is to be made.
ecSet to indicate what error occurred, if any.
Returns:
The number of bytes sent.
Note:
The send operation can only be used with a connected socket. Use the send_to function to send data on an unconnected raw socket.

Definition at line 206 of file basic_raw_socket.hpp.

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
template<typename ConstBufferSequence >
std::size_t asio::basic_raw_socket< Protocol, RawSocketService >::send_to ( const ConstBufferSequence &  buffers,
const endpoint_type destination 
) [inline]

Send raw data to the specified endpoint.

This function is used to send raw data to the specified remote endpoint. The function call will block until the data has been sent successfully or an error occurs.

Parameters:
buffersOne or more data buffers to be sent to the remote endpoint.
destinationThe remote endpoint to which the data will be sent.
Returns:
The number of bytes sent.
Exceptions:
asio::system_errorThrown on failure.
Example
To send a single data buffer use the asio::buffer function as follows:
 asio::ip::udp::endpoint destination(
     asio::ip::address::from_string("1.2.3.4"), 12345);
 socket.send_to(asio::buffer(data, size), destination);
See the asio::buffer documentation for information on sending multiple buffers in one go, and how to use it with arrays, boost::array or std::vector.

Definition at line 314 of file basic_raw_socket.hpp.

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
template<typename ConstBufferSequence >
std::size_t asio::basic_raw_socket< Protocol, RawSocketService >::send_to ( const ConstBufferSequence &  buffers,
const endpoint_type destination,
socket_base::message_flags  flags 
) [inline]

Send raw data to the specified endpoint.

This function is used to send raw data to the specified remote endpoint. The function call will block until the data has been sent successfully or an error occurs.

Parameters:
buffersOne or more data buffers to be sent to the remote endpoint.
destinationThe remote endpoint to which the data will be sent.
flagsFlags specifying how the send call is to be made.
Returns:
The number of bytes sent.
Exceptions:
asio::system_errorThrown on failure.

Definition at line 341 of file basic_raw_socket.hpp.

template<typename Protocol , typename RawSocketService = raw_socket_service<Protocol>>
template<typename ConstBufferSequence >
std::size_t asio::basic_raw_socket< Protocol, RawSocketService >::send_to ( const ConstBufferSequence &  buffers,
const endpoint_type destination,
socket_base::message_flags  flags,
asio::error_code ec 
) [inline]

Send raw data to the specified endpoint.

This function is used to send raw data to the specified remote endpoint. The function call will block until the data has been sent successfully or an error occurs.

Parameters:
buffersOne or more data buffers to be sent to the remote endpoint.
destinationThe remote endpoint to which the data will be sent.
flagsFlags specifying how the send call is to be made.
ecSet to indicate what error occurred, if any.
Returns:
The number of bytes sent.

Definition at line 368 of file basic_raw_socket.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


Castor
Author(s): Carpe Noctem
autogenerated on Fri Nov 8 2013 11:05:40