Used internally to decouple the lifetime of the user connection object from the one "managed" (created/deleted) by AbstractCustomMsgServer/CustomMsgServerDelegate. This way, the user connection can be clear at any time. More...
#include <objectbox-sync.hpp>

Public Member Functions | |
| CustomMsgConnectionDelegate (uint64_t serverId, const std::shared_ptr< AbstractCustomMsgConnection > &connection, bool deleteThisOnShutdown) | |
| ~CustomMsgConnectionDelegate () override=default | |
| void | close () override |
| The connection closing itself (to be implemented by concrete subclass). | |
| void | shutdown () override |
| The connection shall shutdown; e.g. it may delete itself. Note that there is no "automatic" deletion triggered from the custom msg system: often, connections are intertwined with the server and thus deletion must be managed at the implementing side. | |
| bool | sendAsync (BytesLazy &&message) override |
| Offers bytes to be sent asynchronously to the client (to be implemented by concrete subclass). | |
| void | clearOutgoingMessages () override |
| Clear all outgoing messages (to be implemented by concrete subclass). | |
Public Member Functions inherited from obx::AbstractCustomMsgConnection | |
| AbstractCustomMsgConnection (uint64_t serverId, uint64_t id=0) | |
| virtual | ~AbstractCustomMsgConnection ()=default |
| uint64_t | serverId () const |
| uint64_t | id () const |
| void | setId (uint64_t id) |
Used internally to decouple the lifetime of the user connection object from the one "managed" (created/deleted) by AbstractCustomMsgServer/CustomMsgServerDelegate. This way, the user connection can be clear at any time.
|
inlineexplicit |
|
overridedefault |
|
inlineoverridevirtual |
Clear all outgoing messages (to be implemented by concrete subclass).
Implements obx::AbstractCustomMsgConnection.
|
inlineoverridevirtual |
The connection closing itself (to be implemented by concrete subclass).
Implements obx::AbstractCustomMsgConnection.
|
inlineoverridevirtual |
Offers bytes to be sent asynchronously to the client (to be implemented by concrete subclass).
| message | the message bytes. |
Implements obx::AbstractCustomMsgConnection.
|
inlineoverridevirtual |
The connection shall shutdown; e.g. it may delete itself. Note that there is no "automatic" deletion triggered from the custom msg system: often, connections are intertwined with the server and thus deletion must be managed at the implementing side.
Implements obx::AbstractCustomMsgConnection.