Stellarium  0.17.0
Public Member Functions
SyncMessageHandler Class Referenceabstract

Base interface for message handlers, i.e. reacting to messages.

#include <SyncProtocol.hpp>

Public Member Functions

virtual bool handleMessage (QDataStream &stream, SyncProtocol::tPayloadSize dataSize, SyncRemotePeer &peer)=0
 Read a message directly from the stream. More...

Member Function Documentation

virtual bool SyncMessageHandler::handleMessage ( QDataStream &  stream,
SyncProtocol::tPayloadSize  dataSize,
SyncRemotePeer peer 
pure virtual

SyncMessage::deserialize of the correct class should be used to deserialize the message.

streamThe stream to be used to read data. The current position is after the header.
dataSizeThe data size from the message header
peerThe remote peer this message originated from. Can be used to send replies through SyncRemotePeer::writeMessage
return false if the message is found to be invalid. The connection to the client/server will be dropped.

Implemented in DummyMessageHandler, ClientFovHandler, ClientViewHandler, ClientStelPropertyUpdateHandler, ClientSelectionHandler, ClientLocationHandler, ClientTimeHandler, ClientAliveHandler, ServerAliveHandler, ClientAuthHandler, ServerAuthHandler, ClientErrorHandler, and ServerErrorHandler.