asio 0.1.5 Main Page | Class Index | Member Index | Tutorial

buffered_send_stream Class Template Reference

The buffered_send_stream class template can be used to add buffering to the send-related operations of a stream. More...

List of all members.

Public Types

typedef boost::remove_reference<
Next_Layer >::type 
next_layer_type
 The type of the next layer.

typedef next_layer_type::lowest_layer_type lowest_layer_type
 The type of the lowest layer.

typedef next_layer_type::demuxer_type demuxer_type
 The demuxer type for this asynchronous type.


Public Member Functions

template<typename Arg>  buffered_send_stream (Arg &a)
 Construct, passing the specified argument to initialise the next layer.

next_layer_typenext_layer ()
 Get a reference to the next layer.

lowest_layer_typelowest_layer ()
 Get a reference to the lowest layer.

demuxer_typedemuxer ()
 Get the demuxer associated with the asynchronous object.

void close ()
 Close the stream.

size_t send (const void *data, size_t length)
 Send the given data to the peer. Returns the number of bytes sent or 0 if the stream was closed cleanly. Throws an exception on failure.

template<typename Error_Handler> size_t send (const void *data, size_t length, Error_Handler error_handler)
 Send the given data to the peer. Returns the number of bytes sent or 0 if the stream was closed cleanly.

template<typename Handler> void async_send (const void *data, size_t length, Handler handler)
 Start an asynchronous send. The data being sent must be valid for the lifetime of the asynchronous operation.

template<typename Handler, typename Completion_Context> void async_send (const void *data, size_t length, Handler handler, Completion_Context context)
 Start an asynchronous send. The data being sent must be valid for the lifetime of the asynchronous operation.

size_t recv (void *data, size_t max_length)
 Receive some data from the peer. Returns the number of bytes received or 0 if the stream was closed cleanly. Throws an exception on failure.

template<typename Error_Handler> size_t recv (void *data, size_t max_length, Error_Handler error_handler)
 Receive some data from the peer. Returns the number of bytes received or 0 if the stream was closed cleanly.

template<typename Handler> void async_recv (void *data, size_t max_length, Handler handler)
 Start an asynchronous receive. The buffer for the data being received must be valid for the lifetime of the asynchronous operation.

template<typename Handler, typename Completion_Context> void async_recv (void *data, size_t max_length, Handler handler, Completion_Context context)
 Start an asynchronous receive. The buffer for the data being received must be valid for the lifetime of the asynchronous operation.


Private Attributes

Next_Layer next_layer_
 The next layer.


Detailed Description

template<typename Next_Layer, typename Buffer = fixed_buffer<8192>>
class asio::buffered_send_stream< Next_Layer, Buffer >

The buffered_send_stream class template can be used to add buffering to the send-related operations of a stream.


Member Typedef Documentation

typedef boost::remove_reference<Next_Layer>::type next_layer_type
 

The type of the next layer.

typedef next_layer_type::lowest_layer_type lowest_layer_type
 

The type of the lowest layer.

typedef next_layer_type::demuxer_type demuxer_type
 

The demuxer type for this asynchronous type.


Constructor & Destructor Documentation

buffered_send_stream Arg &  a  )  [explicit]
 

Construct, passing the specified argument to initialise the next layer.


Member Function Documentation

next_layer_type& next_layer  ) 
 

Get a reference to the next layer.

lowest_layer_type& lowest_layer  ) 
 

Get a reference to the lowest layer.

demuxer_type& demuxer  ) 
 

Get the demuxer associated with the asynchronous object.

void close  ) 
 

Close the stream.

size_t send const void *  data,
size_t  length
 

Send the given data to the peer. Returns the number of bytes sent or 0 if the stream was closed cleanly. Throws an exception on failure.

size_t send const void *  data,
size_t  length,
Error_Handler  error_handler
 

Send the given data to the peer. Returns the number of bytes sent or 0 if the stream was closed cleanly.

void async_send const void *  data,
size_t  length,
Handler  handler
 

Start an asynchronous send. The data being sent must be valid for the lifetime of the asynchronous operation.

void async_send const void *  data,
size_t  length,
Handler  handler,
Completion_Context  context
 

Start an asynchronous send. The data being sent must be valid for the lifetime of the asynchronous operation.

size_t recv void *  data,
size_t  max_length
 

Receive some data from the peer. Returns the number of bytes received or 0 if the stream was closed cleanly. Throws an exception on failure.

size_t recv void *  data,
size_t  max_length,
Error_Handler  error_handler
 

Receive some data from the peer. Returns the number of bytes received or 0 if the stream was closed cleanly.

void async_recv void *  data,
size_t  max_length,
Handler  handler
 

Start an asynchronous receive. The buffer for the data being received must be valid for the lifetime of the asynchronous operation.

void async_recv void *  data,
size_t  max_length,
Handler  handler,
Completion_Context  context
 

Start an asynchronous receive. The buffer for the data being received must be valid for the lifetime of the asynchronous operation.


Member Data Documentation

Next_Layer next_layer_ [private]
 

The next layer.