Stellarium  HEAD
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. More...

#include <SyncServer.hpp>

Public Slots

bool start (quint16 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=nullptr, bool allowVersionMismatch=false)
 
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) override
 

Friends

class ServerAuthHandler
 

Detailed Description

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

Member Function Documentation

◆ start

bool SyncServer::start ( quint16  port)
slot

Starts the SyncServer on the specified port.

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