libcaf
0.17.1
|
A concrete datagram_handler with a technology-dependent policy. More...
#include <datagram_handler_impl.hpp>
Inherits caf::io::network::datagram_handler.
Public Member Functions | |
template<class... Ts> | |
datagram_handler_impl (default_multiplexer &mpx, native_socket sockfd, Ts &&...xs) | |
void | handle_event (io::network::operation op) override |
Returns true once the requested operation is done, i.e., to signalize the multiplexer to remove this handler. More... | |
![]() | |
datagram_handler (default_multiplexer &backend_ref, native_socket sockfd) | |
void | start (datagram_manager *mgr) |
Starts reading data from the socket, forwarding incoming data to mgr . | |
void | activate (datagram_manager *mgr) |
Activates the datagram handler. | |
void | write (datagram_handle hdl, const void *buf, size_t num_bytes) |
Copies data to the write buffer. More... | |
write_buffer_type & | wr_buf (datagram_handle hdl) |
Returns the write buffer of this enpoint. More... | |
void | enqueue_datagram (datagram_handle hdl, std::vector< char > buf) |
Enqueues a buffer to be sent as a datagram. More... | |
read_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 | removed_from_loop (operation op) override |
void | graceful_shutdown () override |
void | add_endpoint (datagram_handle hdl, const ip_endpoint &ep, const manager_ptr mgr) |
std::unordered_map < datagram_handle, ip_endpoint > & | endpoints () |
const std::unordered_map < datagram_handle, ip_endpoint > & | endpoints () const |
void | remove_endpoint (datagram_handle hdl) |
ip_endpoint & | sending_endpoint () |
![]() | |
event_handler (default_multiplexer &dm, native_socket sockfd) | |
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... | |
virtual void | graceful_shutdown ()=0 |
Shuts down communication on the managed socket, eventually removing this event handler from the I/O loop. 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_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. More... | |
void | ack_writes (bool x) |
Sets whether this event handlers signals successful writes to its parent actor. More... | |
Additional Inherited Members | |
![]() | |
using | manager_ptr = intrusive_ptr< datagram_manager > |
A smart pointer to a datagram manager. | |
using | write_buffer_type = std::vector< char > |
A buffer class providing a compatible interface to std::vector . | |
using | read_buffer_type = network::receive_buffer |
using | job_type = std::pair< datagram_handle, write_buffer_type > |
A job for sending a datagram consisting of the sender and a buffer. | |
![]() | |
template<class Policy > | |
void | handle_event_impl (io::network::operation op, Policy &policy) |
![]() | |
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. | |
![]() | |
native_socket | fd_ |
state | state_ |
int | eventbf_ |
default_multiplexer & | backend_ |
A concrete datagram_handler with a technology-dependent policy.
|
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.