Stellarium  0.17.0
Public Slots | Signals | Public Member Functions | Protected Member Functions | Friends
SyncServer Class Reference

Implements a server to which SyncClients can connect and receive state changes.

#include <SyncServer.hpp>

Public Slots

bool start (int port)
 Starts the SyncServer on the specified port. More...
 
void stop ()
 Disconnects all clients, and stops listening.
 
QString errorString () const
 Returns a string of the last server error.
 

Signals

void serverStopped ()
 Emitted when the server is completely stopped, and all clients have disconnected.
 

Public Member Functions

 SyncServer (QObject *parent=Q_NULLPTR)
 
void update ()
 This should be called in the StelModule::update function.
 
void broadcastMessage (const SyncProtocol::SyncMessage &msg)
 Broadcasts this message to all connected and authenticated clients.
 

Protected Member Functions

void timerEvent (QTimerEvent *evt) Q_DECL_OVERRIDE
 

Friends

class ServerAuthHandler
 

Member Function Documentation

bool SyncServer::start ( int  port)
slot

If the server is already running, stops it first. Returns true if successful (false usually means port was in use, use getErrorString)