Kanzi Connect  3.9.8
Kanzi Connect C++ API
kanzi::connect::ConnectionManagerMessageHookInterface Class Referenceabstract

Interface that can hook incoming messages. More...

#include <connection_manager.hpp>

Inheritance diagram for kanzi::connect::ConnectionManagerMessageHookInterface:
kanzi::connect::ConnectionManager

Public Types

enum  MessageDirection { Incoming, Outgoing }
 

Public Member Functions

virtual optional< MessagePackagemessageHook (MessageDirection direction, int clientId, const MessagePackage &oldPackage)=0
 Called for each and every incoming/outgoing message before it gets processed by any away. More...
 

Detailed Description

Interface that can hook incoming messages.

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

Member Enumeration Documentation

◆ MessageDirection

Enumerator
Incoming 

Incoming message.

Outgoing 

Outgoing message.

Member Function Documentation

◆ messageHook()

virtual optional<MessagePackage> kanzi::connect::ConnectionManagerMessageHookInterface::messageHook ( MessageDirection  direction,
int  clientId,
const MessagePackage oldPackage 
)
pure virtual

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.

Parameters
directionspecifier whether message is incoming or outgoing.
clientIdidentifies the connected client that sent the message.
oldPackagethis is the original package that is to be processed.
Returns
optional message package that shall overwrite the existing one.

The documentation for this class was generated from the following file: