Stellarium  0.21.3
Data Structures | Public Member Functions | Protected Member Functions | Friends
Server Class Referenceabstract

Base class for telescope server classes. More...

#include <Server.hpp>

Public Member Functions

 Server (int port)
 
virtual void step (long long int timeout_micros)
 

Protected Member Functions

void sendPosition (unsigned int ra_int, int dec_int, int status)
 
void addConnection (Socket *s)
 Adds this object to the list of connections maintained by this server. More...
 
void closeAcceptedConnections (void)
 

Friends

class Listener
 
class Connection
 

Detailed Description

A true telescope server class should inherit Server and implement device-specific functions. The class makes heavy use of polymorphism to perform all its work by maintaining a list of connections in the form of Socket pointers. The list actually contains objects of classes that inherit Socket, including one Listener object, created in the constructor, and one or more Connection objects, each representing a TCP/IP connection to a client. Classes that inherit Server (such as ServerLx200) also have a special device-specific connection object (such as Lx200Connection) that represents a serial connection to the device. The step() method calls Socket::prepareSelectFds() and Socket::handleSelectFds() for each connection in the list. These methods are reimplemented for each class.

Member Function Documentation

◆ addConnection()

void Server::addConnection ( Socket s)
inlineprotected

This method is called by Listener.

Parameters
scan be anything that inherits Socket, including Listener, Connection or any custom class that implements a serial port connection (such as Lx200Connection and NexStarConnection).