|
libcaf
0.15.0
|
A stream capable of both reading and writing. More...
#include <default_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. More... | |
Public Member Functions | |
| stream (default_multiplexer &backend_ref, native_socket sockfd) | |
| void | start (const manager_ptr &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 x) |
| 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 () |
| Returns the read buffer of this stream. More... | |
| 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_reading () |
| Closes the read channel of the underlying socket and removes this handler from its parent. More... | |
| void | removed_from_loop (operation op) override |
Callback to signalize that this handler has been removed from the event loop for operations of type op. More... | |
| void | handle_event (operation op) override |
| Returns true once the requested operation is done, i.e., to signalize the multiplexer to remove this handler. More... | |
Public Member Functions inherited from caf::io::network::event_handler | |
| event_handler (default_multiplexer &dm, native_socket fd) | |
| native_socket | fd () const |
| Returns the native socket handle for this handler. | |
| default_multiplexer & | backend () |
Returns the multiplexer this acceptor belongs to. | |
| int | eventbf () const |
| Returns the bit field storing the subscribed events. | |
| void | eventbf (int value) |
| Sets the bit field storing the subscribed events. | |
| bool | read_channel_closed () const |
Checks whether close_read has been called. | |
| void | close_read_channel () |
| Closes the read channel of the underlying socket. | |
Additional Inherited Members | |
Protected Member Functions inherited from caf::io::network::event_handler | |
| void | set_fd_flags () |
Protected Attributes inherited from caf::io::network::event_handler | |
| int | eventbf_ |
| native_socket | fd_ |
| bool | read_channel_closed_ |
| default_multiplexer & | backend_ |
A stream capable of both reading and writing.
The stream's input data is forwarded to its manager.
| using caf::io::network::stream::buffer_type = std::vector<char> |
A buffer class providing a compatible interface to std::vector.
| void caf::io::network::stream::configure_read | ( | receive_policy::config | config | ) |
Configures how much data will be provided for the next consume callback.
| void caf::io::network::stream::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.
|
overridevirtual |
Returns true once the requested operation is done, i.e., to signalize the multiplexer to remove this handler.
The handler remains in the event loop as long as it returns false.
Implements caf::io::network::event_handler.
| buffer_type& caf::io::network::stream::rd_buf | ( | ) |
Returns the read buffer of this stream.
|
overridevirtual |
Callback to signalize that this handler has been removed from the event loop for operations of type op.
Implements caf::io::network::event_handler.
| void caf::io::network::stream::stop_reading | ( | ) |
Closes the read channel of the underlying socket and removes this handler from its parent.
| buffer_type& caf::io::network::stream::wr_buf | ( | ) |
Returns the write buffer of this stream.
| void caf::io::network::stream::write | ( | const void * | buf, |
| size_t | num_bytes | ||
| ) |
Copies data to the write buffer.
1.8.9.1