|
libcaf
0.15.5
|
A stream capable of both reading and writing. More...
#include <asio_multiplexer.hpp>
Public Types | |
| using | manager_ptr = intrusive_ptr< stream_manager > |
| A smart pointer to a stream manager. | |
| using | buffer_type = std::vector< char > |
A buffer class providing a compatible interface to std::vector. | |
Public Member Functions | |
| asio_stream (asio_multiplexer &ref) | |
| Socket & | socket_handle () |
| Returns the IO socket. | |
| const Socket & | socket_handle () const |
| Returns the IO socket. | |
| void | init (Socket fd) |
Initializes this stream, setting the socket handle to fd. | |
| void | start (stream_manager *mgr) |
Starts reading data from the socket, forwarding incoming data to mgr. | |
| void | configure_read (receive_policy::config config) |
Configures how much data will be provided for the next consume callback. More... | |
| void | ack_writes (bool enable) |
| void | write (const void *buf, size_t num_bytes) |
| Copies data to the write buffer. More... | |
| buffer_type & | wr_buf () |
| Returns the write buffer of this stream. More... | |
| buffer_type & | rd_buf () |
| void | flush (const manager_ptr &mgr) |
Sends the content of the write buffer, calling the io_failure member function of mgr in case of an error. More... | |
| void | stop () |
| Closes the network connection, thus stopping this stream. | |
| void | stop_reading () |
| asio_multiplexer & | backend () |
| void | activate (stream_manager *mgr) |
| Activates the stream. | |
| void | passivate () |
| Stops activity of the stream. | |
A stream capable of both reading and writing.
The stream's input data is forwarded to its manager.
| void caf::io::network::asio_stream< Socket >::configure_read | ( | receive_policy::config | config | ) |
Configures how much data will be provided for the next consume callback.
| void caf::io::network::asio_stream< Socket >::flush | ( | const manager_ptr & | mgr | ) |
Sends the content of the write buffer, calling the io_failure member function of mgr in case of an error.
| buffer_type& caf::io::network::asio_stream< Socket >::wr_buf | ( | ) |
Returns the write buffer of this stream.
| void caf::io::network::asio_stream< Socket >::write | ( | const void * | buf, |
| size_t | num_bytes | ||
| ) |
Copies data to the write buffer.
1.8.14