C++ Actor Framework 1.0.0
Loading...
Searching...
No Matches
caf::io::network::event_handler Class Referenceabstract

A socket I/O event handler. More...

#include <event_handler.hpp>

Inheritance diagram for caf::io::network::event_handler:
caf::io::network::acceptor caf::io::network::pipe_reader caf::io::network::stream caf::io::network::acceptor_impl< caf::policy::tcp > caf::io::network::acceptor_impl< ProtocolPolicy > caf::io::network::stream_impl< caf::policy::tcp > caf::io::network::stream_impl< ProtocolPolicy >

Classes

struct  state
 Stores various status flags and user-defined config parameters. More...
 

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.
 
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.
 
virtual void graceful_shutdown ()=0
 Shuts down communication on the managed socket, eventually removing this event handler from the I/O loop.
 
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_channel has been called.
 
void passivate ()
 Removes the file descriptor from the event loop of the parent.
 
bool ack_writes ()
 Returns whether this event handlers signals successful writes to its parent actor.
 
void ack_writes (bool x)
 Sets whether this event handlers signals successful writes to its parent actor.
 

Protected Member Functions

void activate ()
 Adds the file descriptor to the event loop of the parent.
 
void set_fd_flags ()
 Sets flags for asynchronous event handling on the socket handle.
 

Protected Attributes

native_socket fd_
 
state state_
 
int eventbf_
 
default_multiplexer & backend_
 

Detailed Description

A socket I/O event handler.

Member Function Documentation

◆ graceful_shutdown()

virtual void caf::io::network::event_handler::graceful_shutdown ( )
pure virtual

Shuts down communication on the managed socket, eventually removing this event handler from the I/O loop.

Implemented in caf::io::network::acceptor, caf::io::network::pipe_reader, and caf::io::network::stream.

◆ handle_event()

virtual void caf::io::network::event_handler::handle_event ( operation op)
pure virtual

◆ removed_from_loop()

virtual void caf::io::network::event_handler::removed_from_loop ( operation op)
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::pipe_reader, and caf::io::network::stream.


The documentation for this class was generated from the following files: