libcaf
0.15.5
|
A socket I/O event handler. More...
#include <default_multiplexer.hpp>
Public Member Functions | |
event_handler (default_multiplexer &dm, native_socket sockfd) | |
virtual void | handle_event (operation op)=0 |
Returns true once the requested operation is done, i.e., to signalize the multiplexer to remove this handler. More... | |
virtual void | removed_from_loop (operation op)=0 |
Callback to signalize that this handler has been removed from the event loop for operations of type op . More... | |
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. | |
void | passivate () |
Removes the file descriptor from the event loop of the parent. | |
Protected Member Functions | |
void | activate () |
Adds the file descriptor to the event loop of the parent. | |
void | set_fd_flags () |
Protected Attributes | |
int | eventbf_ |
native_socket | fd_ |
bool | read_channel_closed_ |
default_multiplexer & | backend_ |
A socket I/O event handler.
|
pure virtual |
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.
Implemented in caf::io::network::datagram_handler_impl< ProtocolPolicy >, caf::io::network::datagram_handler_impl< caf::io::network::udp_policy >, caf::io::network::acceptor_impl< ProtocolPolicy >, caf::io::network::acceptor_impl< caf::io::network::tcp_policy >, caf::io::network::stream_impl< ProtocolPolicy >, caf::io::network::stream_impl< caf::io::network::tcp_policy >, and caf::io::network::pipe_reader.
|
pure virtual |
Callback to signalize that this handler has been removed from the event loop for operations of type op
.
Implemented in caf::io::network::acceptor, caf::io::network::stream, and caf::io::network::pipe_reader.