Appearance
struct flake::ConnectionSink
Callback interface for connection lifecycle events. More...
#include <platform/flake/Connection.h>
Public Functions
| Name | |
|---|---|
| ConnectionSink(const ConnectionSink & ) =deleted | |
| ConnectionSink & | operator=(const ConnectionSink & ) =deleted |
| ConnectionSink(ConnectionSink && ) =deleted | |
| ConnectionSink & | operator=(ConnectionSink && ) =deleted |
| virtual void | onDisconnected() =0 Called when the connection to the router has been lost. |
| virtual void | onPeerSessions(unsigned open) The number of streams peers hold open on this client's objects changed. |
Protected Functions
| Name | |
|---|---|
| ConnectionSink() =default | |
| ~ConnectionSink() =default |
Detailed Description
cpp
struct flake::ConnectionSink;Callback interface for connection lifecycle events.
Note: Non-copyable, non-movable.
Implement this interface and pass it to one of the flakeInitialize* functions to be notified when the connection to the router drops.
Public Functions Documentation
function ConnectionSink
cpp
ConnectionSink(
const ConnectionSink &
) =deletedfunction operator=
cpp
ConnectionSink & operator=(
const ConnectionSink &
) =deletedfunction ConnectionSink
cpp
ConnectionSink(
ConnectionSink &&
) =deletedfunction operator=
cpp
ConnectionSink & operator=(
ConnectionSink &&
) =deletedfunction onDisconnected
cpp
virtual void onDisconnected() =0Called when the connection to the router has been lost.
The implementation may attempt to reconnect or clean up resources.
function onPeerSessions
cpp
inline virtual void onPeerSessions(
unsigned open
)The number of streams peers hold open on this client's objects changed.
Parameters:
- open Sessions open now.
Counts sessions (one per opener and stream) across all objects of the connection. Drops to 0 when the connection is lost. Runs on the core worker, or on the thread that shuts the connection down; only set a flag or wake a thread here.
Protected Functions Documentation
function ConnectionSink
cpp
ConnectionSink() =defaultfunction ~ConnectionSink
cpp
~ConnectionSink() =default