ConnectionAdapter::Observer

class kanzi::connect::ConnectionAdapter::Observer

Observer class that is used for notifications such as new connections or data.

Subclassed by NetworkListener

Public Functions

virtual bool clientExists(size_t clientId) const = 0

Check whether a client identifier is valid one.

Parameters

clientId – Identifier of the client.

Returns

True if client exists.

inline virtual void onConnected(size_t)

Notification of a newly connected client.

Parameters

clientId – The id of the connected client.

inline virtual void onDisconnected(size_t)

Notification of a disconnected client.

Parameters

clientId – The id of the disconnected client.

inline virtual void onReceive(size_t, const vector<char>&)

Notification of new data from a a client.

Parameters
  • clientId – The id of the client that sent the data.

  • data – The data that was received.