Connection event handler interface.
More...
#include <iconn_handler.h>
|
template<class T > |
void | destroy (T &) |
| No-op. When SharedPtr or ScopedPtr "destroys" object, nothing happens. The user is responsible for destroying it manually. More...
|
|
Connection event handler interface.
Workflow
- first, either connection_refused() or connection_established() is called excactly once for connection
- these two calls are the point where the user can obtain IConn reference for the first time; the same reference will be then passed to other callbacks
- after obtaining IConn reference, the user is responsible for terminating connection when it's no longer needed
- connection_refused() call is possible only for client-side conenction
- after connection is established, connection_writable() and connection_readable() are called repeatedly whenever it becomes possible to write or read data from connection
- if an established connection fails asynchronously, it becomes readable and writable, and the next I/O operation will return error
- after an asynchronous terminate is issued, no other callbacks except connection_terminated() are ever called
- when an asynchronous terminate is completed, connection_terminated() is called; connection is still usable inside this callback
- after connection_terminated() returns, the handler is never ever used for this connection, and the connection is destroyed
- even after connection_terminated() call, the handler should not be destroyed until IConnAcceptor callback
- Note
- Methods are called from the network loop thread.
- Methods should not block.
Definition at line 60 of file iconn_handler.h.
◆ connection_established()
virtual void roc::netio::IConnHandler::connection_established |
( |
IConn & |
conn | ) |
|
|
pure virtual |
Connection successfully established.
◆ connection_readable()
virtual void roc::netio::IConnHandler::connection_readable |
( |
IConn & |
conn | ) |
|
|
pure virtual |
Connection becomes available for reading.
◆ connection_refused()
virtual void roc::netio::IConnHandler::connection_refused |
( |
IConn & |
conn | ) |
|
|
pure virtual |
Connection can't be established.
◆ connection_terminated()
virtual void roc::netio::IConnHandler::connection_terminated |
( |
IConn & |
conn | ) |
|
|
pure virtual |
Connection is terminated and can't be accessed after this call.
◆ connection_writable()
virtual void roc::netio::IConnHandler::connection_writable |
( |
IConn & |
conn | ) |
|
|
pure virtual |
Connection becomes available for writing.
The documentation for this class was generated from the following file: