fgms 0.13.5
The
FlightGear MultiPlayer Server
project
FG_TRACKER Class Reference

The tracker class. More...

#include <fg_tracker.hxx>

Classes

struct  buffsock
 

Public Types

typedef struct FG_TRACKER::buffsock buffsock_t
 
typedef vMSG::iterator VI
 
typedef std::vector< std::string > vMSG
 

Public Member Functions

 FG_TRACKER (int port, string server, string m_ServerName, string m_domain)
 Initialize to standard values. More...
 
 ~FG_TRACKER ()
 
void AddMessage (const string &message)
 
void buffsock_free (buffsock_t *bs)
 
void CheckTimeout ()
 
bool Connect ()
 
pthread_t GetThreadID ()
 
int GetTrackerPort ()
 Return the port no of the tracker. More...
 
string GetTrackerServer ()
 Return the server of the tracker. More...
 
int Loop ()
 
void ReadQueue ()
 
void ReplyFromServer ()
 
void ReQueueSentMsg ()
 
void TrackerRead (buffsock_t *bs)
 
int TrackerWrite (const string &str)
 
void WriteQueue ()
 

Static Public Member Functions

static bool is_connected ()
 
static void set_connected (bool b)
 

Public Attributes

uint64_t BytesRcvd
 
uint64_t BytesSent
 
pthread_cond_t condition_var
 
time_t LastConnected
 
time_t LastSeen
 
time_t LastSent
 
size_t LostConnections
 
string m_domain
 
string m_FgmsName
 
bool m_identified
 
int m_PingInterval
 
string m_ProtocolVersion
 
int m_TimeoutStage
 
int m_TrackerPort
 
string m_TrackerServer
 
netSocketm_TrackerSocket
 
pthread_mutex_t msg_mutex
 
vMSG msg_queue
 
pthread_mutex_t msg_recv_mutex
 
vMSG msg_recv_queue
 
pthread_mutex_t msg_sent_mutex
 
vMSG msg_sent_queue
 
pthread_t MyThreadID
 
uint64_t PktsRcvd
 
uint64_t PktsSent
 
bool WantExit
 

Static Public Attributes

static bool m_connected = false
 

Detailed Description

The tracker class.

Definition at line 61 of file fg_tracker.hxx.

Member Typedef Documentation

◆ buffsock_t

◆ VI

typedef vMSG::iterator FG_TRACKER::VI

Definition at line 81 of file fg_tracker.hxx.

◆ vMSG

typedef std::vector<std::string> FG_TRACKER::vMSG

Definition at line 80 of file fg_tracker.hxx.

Constructor & Destructor Documentation

◆ FG_TRACKER()

FG_TRACKER::FG_TRACKER ( int  port,
string  server,
string  m_ServerName,
string  domain 
)

Initialize to standard values.

Parameters
port
serverip or domain
fgmsname

Definition at line 94 of file fg_tracker.cxx.

◆ ~FG_TRACKER()

FG_TRACKER::~FG_TRACKER ( )

Definition at line 123 of file fg_tracker.cxx.

Member Function Documentation

◆ AddMessage()

void FG_TRACKER::AddMessage ( const string &  message)

Definition at line 246 of file fg_tracker.cxx.

Referenced by FG_SERVER::UpdateTracker().

◆ buffsock_free()

void FG_TRACKER::buffsock_free ( buffsock_t bs)

Definition at line 260 of file fg_tracker.cxx.

Referenced by Loop(), and TrackerRead().

◆ CheckTimeout()

void FG_TRACKER::CheckTimeout ( )

Definition at line 270 of file fg_tracker.cxx.

Referenced by Loop().

◆ Connect()

bool FG_TRACKER::Connect ( )

Definition at line 593 of file fg_tracker.cxx.

Referenced by Loop().

◆ GetThreadID()

pthread_t FG_TRACKER::GetThreadID ( )

Definition at line 142 of file fg_tracker.cxx.

Referenced by FG_SERVER::CloseTracker().

◆ GetTrackerPort()

int FG_TRACKER::GetTrackerPort ( )
inline

Return the port no of the tracker.

Return values
intPort Number

Definition at line 125 of file fg_tracker.hxx.

Referenced by FG_CLI::cmd_tracker_show(), and FG_SERVER::Init().

◆ GetTrackerServer()

string FG_TRACKER::GetTrackerServer ( )
inline

Return the server of the tracker.

Return values
stringReturn tracker server as string

Definition at line 119 of file fg_tracker.hxx.

Referenced by FG_CLI::cmd_show_version(), FG_CLI::cmd_tracker_show(), FG_SERVER::HandleTelnet(), and FG_SERVER::Init().

◆ is_connected()

static bool FG_TRACKER::is_connected ( )
inlinestatic

Definition at line 98 of file fg_tracker.hxx.

Referenced by Loop().

◆ Loop()

int FG_TRACKER::Loop ( )

Definition at line 474 of file fg_tracker.cxx.

Referenced by detach_tracker().

◆ ReadQueue()

void FG_TRACKER::ReadQueue ( )

Definition at line 152 of file fg_tracker.cxx.

Referenced by Loop().

◆ ReplyFromServer()

void FG_TRACKER::ReplyFromServer ( )

Definition at line 413 of file fg_tracker.cxx.

Referenced by TrackerRead().

◆ ReQueueSentMsg()

void FG_TRACKER::ReQueueSentMsg ( )

Definition at line 227 of file fg_tracker.cxx.

Referenced by Loop(), and ReadQueue().

◆ set_connected()

static void FG_TRACKER::set_connected ( bool  b)
inlinestatic

Definition at line 97 of file fg_tracker.hxx.

Referenced by CheckTimeout(), FG_TRACKER(), Loop(), signal_handler(), TrackerRead(), and TrackerWrite().

◆ TrackerRead()

void FG_TRACKER::TrackerRead ( buffsock_t bs)

Definition at line 303 of file fg_tracker.cxx.

Referenced by Loop().

◆ TrackerWrite()

int FG_TRACKER::TrackerWrite ( const string &  str)

Definition at line 368 of file fg_tracker.cxx.

Referenced by CheckTimeout(), Connect(), Loop(), and ReplyFromServer().

◆ WriteQueue()

void FG_TRACKER::WriteQueue ( )

Definition at line 193 of file fg_tracker.cxx.

Referenced by ~FG_TRACKER().

Member Data Documentation

◆ BytesRcvd

uint64_t FG_TRACKER::BytesRcvd

Definition at line 151 of file fg_tracker.hxx.

Referenced by FG_CLI::cmd_tracker_show(), FG_TRACKER(), and TrackerRead().

◆ BytesSent

uint64_t FG_TRACKER::BytesSent

Definition at line 150 of file fg_tracker.hxx.

Referenced by FG_CLI::cmd_tracker_show(), FG_TRACKER(), and TrackerWrite().

◆ condition_var

pthread_cond_t FG_TRACKER::condition_var

Definition at line 90 of file fg_tracker.hxx.

Referenced by AddMessage(), FG_SERVER::CloseTracker(), Loop(), and ReQueueSentMsg().

◆ LastConnected

time_t FG_TRACKER::LastConnected

Definition at line 147 of file fg_tracker.hxx.

Referenced by FG_CLI::cmd_tracker_show(), Connect(), and FG_TRACKER().

◆ LastSeen

time_t FG_TRACKER::LastSeen

Definition at line 148 of file fg_tracker.hxx.

Referenced by CheckTimeout(), FG_CLI::cmd_tracker_show(), FG_TRACKER(), and TrackerRead().

◆ LastSent

time_t FG_TRACKER::LastSent

Definition at line 149 of file fg_tracker.hxx.

Referenced by FG_CLI::cmd_tracker_show(), FG_TRACKER(), and TrackerWrite().

◆ LostConnections

size_t FG_TRACKER::LostConnections

◆ m_connected

bool FG_TRACKER::m_connected = false
static

Definition at line 96 of file fg_tracker.hxx.

Referenced by FG_CLI::cmd_tracker_show().

◆ m_domain

string FG_TRACKER::m_domain

Definition at line 75 of file fg_tracker.hxx.

Referenced by Connect(), and FG_TRACKER().

◆ m_FgmsName

string FG_TRACKER::m_FgmsName

Definition at line 74 of file fg_tracker.hxx.

Referenced by Connect(), and FG_TRACKER().

◆ m_identified

bool FG_TRACKER::m_identified

Definition at line 77 of file fg_tracker.hxx.

Referenced by FG_TRACKER(), Loop(), and ReplyFromServer().

◆ m_PingInterval

int FG_TRACKER::m_PingInterval

Definition at line 71 of file fg_tracker.hxx.

Referenced by CheckTimeout(), and FG_TRACKER().

◆ m_ProtocolVersion

string FG_TRACKER::m_ProtocolVersion

Definition at line 76 of file fg_tracker.hxx.

Referenced by Connect(), FG_TRACKER(), and TrackerWrite().

◆ m_TimeoutStage

int FG_TRACKER::m_TimeoutStage

Definition at line 72 of file fg_tracker.hxx.

Referenced by CheckTimeout(), FG_TRACKER(), Loop(), and TrackerRead().

◆ m_TrackerPort

int FG_TRACKER::m_TrackerPort

Definition at line 70 of file fg_tracker.hxx.

Referenced by Connect(), and FG_TRACKER().

◆ m_TrackerServer

string FG_TRACKER::m_TrackerServer

Definition at line 73 of file fg_tracker.hxx.

Referenced by Connect(), and FG_TRACKER().

◆ m_TrackerSocket

netSocket* FG_TRACKER::m_TrackerSocket

Definition at line 78 of file fg_tracker.hxx.

Referenced by Connect(), FG_TRACKER(), TrackerRead(), TrackerWrite(), and ~FG_TRACKER().

◆ msg_mutex

pthread_mutex_t FG_TRACKER::msg_mutex

Definition at line 87 of file fg_tracker.hxx.

Referenced by AddMessage(), Loop(), ReQueueSentMsg(), WriteQueue(), and ~FG_TRACKER().

◆ msg_queue

vMSG FG_TRACKER::msg_queue

◆ msg_recv_mutex

pthread_mutex_t FG_TRACKER::msg_recv_mutex

Definition at line 89 of file fg_tracker.hxx.

Referenced by Loop().

◆ msg_recv_queue

vMSG FG_TRACKER::msg_recv_queue

Definition at line 93 of file fg_tracker.hxx.

Referenced by ReplyFromServer(), TrackerRead(), and ~FG_TRACKER().

◆ msg_sent_mutex

pthread_mutex_t FG_TRACKER::msg_sent_mutex

◆ msg_sent_queue

vMSG FG_TRACKER::msg_sent_queue

◆ MyThreadID

pthread_t FG_TRACKER::MyThreadID

Definition at line 155 of file fg_tracker.hxx.

Referenced by GetThreadID(), and Loop().

◆ PktsRcvd

uint64_t FG_TRACKER::PktsRcvd

Definition at line 153 of file fg_tracker.hxx.

Referenced by FG_CLI::cmd_tracker_show(), FG_TRACKER(), and TrackerRead().

◆ PktsSent

uint64_t FG_TRACKER::PktsSent

Definition at line 152 of file fg_tracker.hxx.

Referenced by FG_CLI::cmd_tracker_show(), FG_TRACKER(), and TrackerWrite().

◆ WantExit

bool FG_TRACKER::WantExit

Definition at line 94 of file fg_tracker.hxx.

Referenced by FG_SERVER::CloseTracker(), FG_TRACKER(), and Loop().


The documentation for this class was generated from the following files: