20 #ifndef SYNCSERVER_HPP_ 21 #define SYNCSERVER_HPP_ 23 #include "SyncProtocol.hpp" 25 #include <QAbstractSocket> 56 void timerEvent(QTimerEvent* evt) Q_DECL_OVERRIDE;
58 void handleNewConnection();
59 void connectionError(QAbstractSocket::SocketError err);
62 void clientDataReceived();
63 void clientError(QAbstractSocket::SocketError);
65 void clientDisconnected();
70 void clientLog(QAbstractSocket* cl,
const QString& msg);
74 QVector<SyncMessageHandler*> handlerList;
75 QVector<SyncServerEventSender*> senderList;
78 typedef QMap<QAbstractSocket*,SyncRemotePeer> tClientMap;
81 QByteArray broadcastBuffer;
QString errorString() const
Returns a string of the last server error.
Server-side auth handler.
Handling the connection to a remote peer (i.e. all clients on the server, and the server on the clien...
Subclasses of this class notify clients of state changes.
void stop()
Disconnects all clients, and stops listening.
Base interface for the messages themselves, allowing to serialize/deserialize them.
void broadcastMessage(const SyncMessage &msg)
Broadcasts this message to all connected and authenticated clients.
void update()
This should be called in the StelModule::update function.
bool start(int port)
Starts the SyncServer on the specified port.
Implements a server to which SyncClients can connect and receive state changes.