20 #ifndef SERVER_PINGER_H 21 #define SERVER_PINGER_H csString GetDescription()
unsigned int lost
the number of ping messages lost
int GetPing()
Returns currently measured ping to server is miliseconds.
bool waiting
are we waiting for ping response from server ?
unsigned int pingID
unique identifier of ping message - enables us to ignore ping responses that come after timeout ...
unsigned int flags
Last flags returned from server. Should only be used if ping != -1 && ping != 9999.
bool Initialize()
Initialize the connection.
psNetConnection * connection
int lastPingTime
the time when we sent our last ping to server
int ping
last measured ping (-1 means timeout, 9999 means wait)
A queue of smart pointers with locking facilties for multi-threading.
unsigned int sent
the number of ping messages sent
int GetFlags()
Returns last received flags from server.
bool Connect()
Opens connection to server.
Class psServerPinger takes care about sending pings to a server in Login screen.
psServerPinger(const csString &serverName, const csString &description, const csString &address, int port, iObjectRegistry *objReg)
void Disconnect()
Sends server disconnection message.
void DoYourWork()
Call this periodically.