#include <ArClientSwitchManager.h>
Inheritance diagram for ArClientSwitchManager:
Some program command line options can be used to configure this class:
Public Member Functions | |
ArClientSwitchManager (ArServerBase *serverBase, ArArgumentParser *parser) | |
void | clientSwitch (ArNetPacket *packet) |
The handler for the response to the switch command. | |
const char * | getCentralServerHostName (void) |
Gets the hostname we're using for the central server (NULL means we're not trying to sue the central server). | |
bool | getDebugLogging (void) |
Gets if this is using debug logging. | |
bool | isConnected (void) |
Returns if we're connected or not. | |
void | logOptions (void) const |
Log the options the simple connector has. | |
void | netCentralHeartbeat (ArServerClient *client, ArNetPacket *packet) |
The handler for the packet to let the server know we're still talking to it. | |
void | netCentralServerHeartbeat (ArServerClient *client, ArNetPacket *packet) |
bool | parseArgs (void) |
Function to parse the arguments given in the constructor. | |
bool | parseFile (const char *fileName) |
Parses the file for holding the user, password, and server key. | |
virtual void * | runThread (void *arg) |
void | setDebugLogging (bool debugLogging=false) |
Sets debug logging. | |
Protected Types | |
enum | State { IDLE, TRYING_CONNECTION, CONNECTING, CONNECTED, LOST_CONNECTION } |
Protected Member Functions | |
bool | filePasswordCallback (ArArgumentBuilder *arg) |
bool | fileServerKeyCallback (ArArgumentBuilder *arg) |
bool | fileUserCallback (ArArgumentBuilder *arg) |
bool | processFile (void) |
void | socketClosed (void) |
void | switchState (State state) |
Protected Attributes | |
std::string | myCentralServer |
int | myCentralServerPort |
ArClientBase * | myClient |
ArMutex | myDataMutex |
bool | myDebugLogging |
ArFileParser | myFileParser |
ArRetFunctor1C< bool, ArClientSwitchManager, ArArgumentBuilder * > | myFilePasswordCB |
ArRetFunctor1C< bool, ArClientSwitchManager, ArArgumentBuilder * > | myFileServerKeyCB |
ArRetFunctor1C< bool, ArClientSwitchManager, ArArgumentBuilder * > | myFileUserCB |
std::string | myIdentifier |
ArTime | myLastConnectionAttempt |
ArTime | myLastTcpHeartbeat |
ArTime | myLastUdpHeartbeat |
ArConstFunctorC< ArClientSwitchManager > | myLogOptionsCB |
ArFunctor2C< ArClientSwitchManager, ArServerClient *, ArNetPacket * > | myNetCentralHeartbeatCB |
ArFunctor2C< ArClientSwitchManager, ArServerClient *, ArNetPacket * > | myNetCentralServerHeartbeatCB |
ArRetFunctorC< bool, ArClientSwitchManager > | myParseArgsCB |
ArArgumentParser * | myParser |
std::string | myPassword |
ArRetFunctorC< bool, ArClientSwitchManager > | myProcessFileCB |
ArServerBase * | myServer |
double | myServerBackupTimeout |
ArServerClient * | myServerClient |
bool | myServerHasHeartbeat |
double | myServerHeartbeatTimeout |
std::string | myServerKey |
double | myServerUdpHeartbeatTimeout |
ArFunctorC< ArClientSwitchManager > | mySocketClosedCB |
ArTime | myStartedState |
State | myState |
ArFunctor1C< ArClientSwitchManager, ArNetPacket * > | mySwitchCB |
bool | myTryConnection |
std::string | myUser |
enum ArClientSwitchManager::State [protected] |
void ArClientSwitchManager::netCentralServerHeartbeat | ( | ArServerClient * | client, | |
ArNetPacket * | packet | |||
) |
The handler for the packet that comes from the server so we know we're getting these