Adds buffering to the write-related operations of a stream.
template< typename Stream> class buffered_write_stream : noncopyable
Name |
Description |
---|---|
The type of the lowest layer. |
|
The type of the next layer. |
Name |
Description |
---|---|
Start an asynchronous flush. |
|
Start an asynchronous read. The buffer into which the data will be read must be valid for the lifetime of the asynchronous operation. |
|
Start an asynchronous write. The data being written must be valid for the lifetime of the asynchronous operation. |
|
Construct, passing the specified argument to initialise the next layer. |
|
Close the stream. |
|
Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation. Throws an exception on failure. Flush all data from the buffer to the next layer. Returns the number of bytes written to the next layer on the last write operation, or 0 if an error occurred. |
|
Get the io_service associated with the object. |
|
Determine the amount of data that may be read without blocking. |
|
Get a reference to the lowest layer. Get a const reference to the lowest layer. |
|
Get a reference to the next layer. |
|
Peek at the incoming data on the stream. Returns the number of bytes read. Throws an exception on failure. Peek at the incoming data on the stream. Returns the number of bytes read, or 0 if an error occurred. |
|
Read some data from the stream. Returns the number of bytes read. Throws an exception on failure. Read some data from the stream. Returns the number of bytes read or 0 if an error occurred. |
|
Write the given data to the stream. Returns the number of bytes written. Throws an exception on failure. Write the given data to the stream. Returns the number of bytes written, or 0 if an error occurred and the error handler did not throw. |
Name |
Description |
---|---|
The default buffer size. |
The buffered_write_stream
class template can be used to add buffering to the synchronous and asynchronous
write operations of a stream.
Distinct objects: Safe.
Shared objects: Unsafe.
Header: asio/buffered_write_stream.hpp
Convenience header: asio.hpp