A datagram manager provides callbacks for outgoing datagrams as well as for error handling.
More...
|
| virtual bool | consume (execution_unit *, datagram_handle hdl, receive_buffer &buf)=0 |
| | Called by the underlying I/O device whenever it received data.
|
| |
|
virtual void | datagram_sent (execution_unit *, datagram_handle hdl, size_t, std::vector< char > buffer)=0 |
| | Called by the underlying I/O device whenever it sent data.
|
| |
| virtual bool | new_endpoint (receive_buffer &buf)=0 |
| | Called by the underlying I/O device to indicate that a new remote endpoint has been detected, passing in the received datagram.
|
| |
|
virtual uint16_t | port (datagram_handle) const =0 |
| | Get the port of the underlying I/O device.
|
| |
| void | set_parent (abstract_broker *ptr) |
| | Sets the parent for this manager.
|
| |
|
abstract_broker * | parent () |
| | Returns the parent broker of this manager.
|
| |
|
bool | detached () const |
| | Returns true if this manager has a parent, false otherwise.
|
| |
|
void | detach (execution_unit *ctx, bool invoke_disconnect_message) |
| | Detach this manager from its parent and invoke detach_message() ifinvoke_detach_message == true`.
|
| |
|
virtual void | graceful_shutdown ()=0 |
| | Causes the manager to gracefully close its connection.
|
| |
|
virtual void | remove_from_loop ()=0 |
| | Removes the I/O device to the event loop of the middleman.
|
| |
|
virtual void | add_to_loop ()=0 |
| | Adds the I/O device to the event loop of the middleman.
|
| |
|
void | io_failure (execution_unit *ctx, operation op) |
| | Detaches this manager from its parent in case of an error.
|
| |
|
virtual std::string | addr () const =0 |
| | Get the address of the underlying I/O device.
|
| |
|
| ref_counted (const ref_counted &) |
| |
|
ref_counted & | operator= (const ref_counted &) |
| |
|
void | ref () const noexcept |
| | Increases reference count by one.
|
| |
|
void | deref () const noexcept |
| | Decreases reference count by one and calls request_deletion when it drops to zero.
|
| |
|
bool | unique () const noexcept |
| | Queries whether there is exactly one reference.
|
| |
|
size_t | get_reference_count () const noexcept |
| |
| virtual void | request_deletion (bool decremented_rc) const noexcept |
| | Default implementations calls `delete this, but can be overriden in case deletion depends on some condition or the class doesn't use default new/delete.
|
| |
A datagram manager provides callbacks for outgoing datagrams as well as for error handling.