|
C++ Actor Framework 1.0.0
|
An acceptor is responsible for accepting incoming connections. More...
#include <acceptor.hpp>
Public Types | |
| using | manager_type = acceptor_manager |
A manager providing the accept member function. | |
| using | manager_ptr = intrusive_ptr<manager_type> |
| A smart pointer to an acceptor manager. | |
Public Member Functions | |
| acceptor (default_multiplexer &backend_ref, native_socket sockfd) | |
| native_socket & | accepted_socket () |
| Returns the accepted socket. | |
| void | start (acceptor_manager *mgr) |
Starts this acceptor, forwarding all incoming connections to manager. | |
| void | activate (acceptor_manager *mgr) |
| Activates the acceptor. | |
| 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. | |
| void | graceful_shutdown () override |
| Shuts down communication on the managed socket, eventually removing this event handler from the I/O loop. | |
Public Member Functions inherited from caf::io::network::event_handler | |
| 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. | |
| 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 | |
| template<class Policy > | |
| void | handle_event_impl (io::network::operation op, Policy &policy) |
Protected Member Functions inherited from caf::io::network::event_handler | |
| 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. | |
Additional Inherited Members | |
Protected Attributes inherited from caf::io::network::event_handler | |
| native_socket | fd_ |
| state | state_ |
| int | eventbf_ |
| default_multiplexer & | backend_ |
An acceptor is responsible for accepting incoming connections.
| native_socket & caf::io::network::acceptor::accepted_socket | ( | ) |
Returns the accepted socket.
This member function should be called only from the new_connection callback.
|
overridevirtual |
Shuts down communication on the managed socket, eventually removing this event handler from the I/O loop.
Implements caf::io::network::event_handler.
|
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::acceptor::start | ( | acceptor_manager * | mgr | ) |
Starts this acceptor, forwarding all incoming connections to manager.
The intrusive pointer will be released after the acceptor has been closed or an IO error occurred.