ConnectionManagerMessageHookInterface

class kanzi::connect::ConnectionManagerMessageHookInterface

Interface that can hook incoming messages.

Can be installed to intercept all incoming messages before they are processed in any way

Subclassed by ConnectionManager

Public Types

enum MessageDirection

Values:

enumerator Incoming

Incoming message.

enumerator Outgoing

Outgoing message.

Public Functions

virtual optional<MessagePackage> messageHook(MessageDirection direction, int clientId, const MessagePackage &oldPackage) = 0

Called for each and every incoming/outgoing message before it gets processed by any away.

This is a very low level handler should be very fast to execute in order not to affect whole system performance. It is essential not to cache any of the passed parameters by reference/pointer.

Return

optional message package that shall overwrite the existing one.

Parameters
  • direction: specifier whether message is incoming or outgoing.

  • clientId: identifies the connected client that sent the message.

  • oldPackage: this is the original package that is to be processed.