#include <MessageHandler.hpp>
|
| | MessageHandler (uint16_t port, util::Logging &log, const std::string &protocolName="") |
| |
| virtual void | send (const messages::Message &message, int client) |
| |
| virtual void | send (const messages::ReplayMessage &message, int client) |
| |
| virtual | ~MessageHandler ()=default |
| |
|
| const util::Listener< int > | onConnect |
| |
const util::Listener
< messages::Message, int > | onReceive |
| |
| const util::Listener< int > | onClose |
| |
The MessageHandler is responsible for the abstraction between the raw data from the Websocket and Message-Objects. Furthermore it provides an abstraction for connections.
| communication::MessageHandler::MessageHandler |
( |
uint16_t |
port, |
|
|
util::Logging & |
log, |
|
|
const std::string & |
protocolName = "" |
|
) |
| |
CTor, create a new message handler.
- Parameters
-
| port | the port used for the websocket |
| log | a reference to the logger |
| protocolName | the name of the websocket protocol, "http-only" by default |
- See Also
- Logger for more information on the Logger
| virtual communication::MessageHandler::~MessageHandler |
( |
| ) |
|
|
virtualdefault |
| void communication::MessageHandler::send |
( |
const messages::Message & |
message, |
|
|
int |
client |
|
) |
| |
|
virtual |
Send a message to the client specified by id
- Parameters
-
| message | the message to send |
| client | the client to which to send the message |
| void communication::MessageHandler::send |
( |
const messages::ReplayMessage & |
message, |
|
|
int |
client |
|
) |
| |
|
virtual |
Send a replayMessage to the client specified by id
- Parameters
-
| message | the replayMessage to send |
| client | the client to which to send the message |
| const util::Listener<int> communication::MessageHandler::onClose |
Listener, that gets called when a client closes the connection
| const util::Listener<int> communication::MessageHandler::onConnect |
Listener that gets called on every new connection
| const util::Listener<messages::Message,int> communication::MessageHandler::onReceive |
Listener, that gets called on every new Message
The documentation for this class was generated from the following files: