Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages | Examples

ArClientBase Class Reference

The base client class. More...

#include <ArClientBase.h>

Inheritance diagram for ArClientBase:

ArASyncTask ArThread List of all members.

Public Types

enum  { CLIENT_KEY_LENGTH = 16 }
enum  ClientState {
  STATE_NO_CONNECTION, STATE_FAILED_CONNECTION, STATE_OPENED_SOCKET, STATE_EXCHANGED_INTROS,
  STATE_REJECTED, STATE_WAITING_LIST, STATE_CONNECTED, STATE_LOST_CONNECTION
}
 The state of the connection. More...

Public Member Functions

void addCycleCallback (ArFunctor *functor)
 Adds a functor to call every cycle.
void addDisconnectOnErrorCB (ArFunctor *functor, ArListPos::Pos position=ArListPos::LAST)
 Adds a call for when a disconnection has occured because of error.
bool addHandler (const char *name, ArFunctor1< ArNetPacket * > *functor)
 Adds a functor for some particular data.
void addServerShutdownCB (ArFunctor *functor, ArListPos::Pos position=ArListPos::LAST)
 Adds a call for when the server shuts down.
 ArClientBase ()
 Constructor.
bool blockingConnect (const char *host, int port, bool print=true, const char *user=NULL, const char *password=NULL)
 Connect to a server.
bool dataExists (const char *name)
 Sees if this data exists.
bool disconnect (void)
 This method blocks while the connection is being shutdown.
unsigned int findCommandFromName (const char *name)
 Returns the command number from the name.
void finishNonBlockingDisconnect ()
 This method should be used in conjunction with startNonBlockingDisconnect in threads that should not block (such as the main GUI thread).
void getClientKey (unsigned char key[CLIENT_KEY_LENGTH])
 Gets a (probably) unique key that can be used to identify the client (after connection).
int getConnectTimeoutTime (void)
 Gets the time allowed for connection.
const std::map< unsigned int,
ArClientData * > * 
getDataMap (void)
 Internal function get get the data map.
const char * getHost (void)
 Gets the name of the host we tried to connect to.
ArTime getLastPacketReceived (void)
 Gets the last time a packet was received.
const char * getName (unsigned int command, bool internalCall=false)
 Gets the name of the data a command is.
const char * getName (ArNetPacket *packet, bool internalCall=false)
 Gets the name of the data a packet is for.
bool getReceivedArgRetList (void)
 Gets if we received the list of arguments and.
bool getReceivedDataList (void)
 Gets if we received the list of commands.
bool getReceivedGroupAndFlagsList (void)
 Gets if we received the list of commands.
int getRejected (void)
 Tells us the reason the connection was rejected (see ArServerCommands for details).
const char * getRejectedString (void)
 Tells us the reason the connection was rejected (see ArServerCommands for details).
virtual const char * getRobotName () const
 Returns the optional name of the connected robot for debugging purposes.
in_addr * getTcpAddr (void)
 Internal function to get the socket (no one should need this).
ArSocketgetTcpSocket (void)
 Internal function to get the tcp socket.
ArSocketgetUdpSocket (void)
 Internal function to get the udp socket.
bool internalBlockingConnect (const char *host, int port, bool print, const char *user, const char *password, ArSocket *tcpSocket)
 Internal function that'll do the connection (mainly for switch connections).
bool isConnected (void)
 true if we're connected to a server
bool isTcpOnlyFromServer (void)
 Returns whether we only get TCP data from the server not UDP.
bool isTcpOnlyToServer (void)
 Returns whether we only send TCP data to the server.
void logDataList (void)
 Print out or data with descriptions.
void logTracking (bool terse)
 Logs the tracking information (packet and byte counts).
void loopOnce (void)
 Run the loop once.
void processPacket (ArNetPacket *packet, bool tcp)
 Process the packet wherever it came from.
void processPacketUdp (ArNetPacket *packet, struct sockaddr_in *sin)
 Process a packet from udp (just hands off to processPacket).
void remCycleCallback (ArFunctor *functor)
 Removes a functor called every cycle.
void remDisconnectOnErrorCB (ArFunctor *functor)
 Removes a call for when a disconnection has occured because of error.
bool remHandler (const char *name, ArFunctor1< ArNetPacket * > *functor)
 Removes a functor for some particular data by name.
void remServerShutdownCB (ArFunctor *functor)
 Removes a call for when the server shuts down.
bool request (const char *name, long mSec, ArNetPacket *packet=NULL)
 Request some data every mSec milliseconds.
bool requestByCommand (unsigned int command, long mSec, ArNetPacket *packet=NULL)
 Request some data every mSec milliseconds by command not name.
bool requestOnce (const char *name, ArNetPacket *packet=NULL, bool quiet=false)
 Request some data (or send a command) just once.
bool requestOnceByCommand (unsigned int command, ArNetPacket *packet=NULL)
 Request some data (or send a command) just once by command not name.
bool requestOnceByCommandUdp (unsigned int command, ArNetPacket *packet=NULL)
 Request some data (or send a command) just once by command not name.
bool requestOnceUdp (const char *name, ArNetPacket *packet=NULL)
 Request some data (or send a command) just once by UDP.
bool requestOnceWithString (const char *name, const char *str)
 Request some data (or send a command) just once with a string as argument.
bool requestStop (const char *name)
 Don't want this data anymore.
bool requestStopByCommand (unsigned int command)
 Don't want this data anymore, by command not name.
void resetTracking (void)
 Clears the tracking information (resets counters).
virtual void run (void)
 Runs the client in this thread.
virtual void runAsync (void)
 Runs the client in its own thread.
virtual void * runThread (void *arg)
bool sendPacketTcp (ArNetPacket *packet)
 Send a packet over TCP.
bool sendPacketUdp (ArNetPacket *packet)
 Send a packet over UDP (unless client only wants tcp then sends over tcp).
void setConnectTimeoutTime (int sec)
 Sets the time to allow for connection (default 3).
virtual void setRobotName (const char *name)
 Sets the optional name of the connected robot for debugging purposes.
void setServerKey (const char *serverKey, bool print=true)
 Sets the 'key' needed to connect to the server.
void setTcpOnlyFromServer (void)
 Sets it so we only get TCP data from the server not UDP.
void setTcpOnlyToServer (void)
 Sets it so we only send TCP data to the server.
bool startNonBlockingDisconnect ()
 This method should be called in threads that should not block (such as the main GUI thread).
bool wasRejected (void)
 true if a server connection attempt failed because the server rejected the username or password, false if the connection failed for another reason, or the username/password were accepted.
virtual ~ArClientBase ()
 Destructor.

Protected Member Functions

void buildList (ArNetPacket *packet)
void clear (void)
bool internalConnect (const char *host, int port, bool obsolete)
void internalStartUdp (void)
void internalSwitchState (ClientState state)
bool setupPacket (ArNetPacket *packet)
void trackPacketReceived (ArNetPacket *packet, bool tcp)
void trackPacketSent (ArNetPacket *packet, bool tcp)

Protected Attributes

long myAuthKey
ArMutex myCallbackMutex
unsigned char myClientKey [16]
ArMutex myClientMutex
ArMutex myCycleCallbackMutex
std::list< ArFunctor * > myCycleCallbacks
ArMutex myDataMutex
std::list< ArFunctor * > myDisconnectOnErrorCBList
std::string myHost
std::map< unsigned int, ArClientData * > myIntDataMap
long myIntroKey
ArTime myLastPacketReceived
std::string myLogPrefix
 Optional prefix to be inserted at the start of log messages.
ArMutex myMapsMutex
std::map< std::string, unsigned
int > 
myNameIntMap
ArMutex myPacketTrackingMutex
std::string myPassword
ArFunctor2C< ArClientBase,
ArNetPacket *, bool > 
myProcessPacketCB
ArFunctor2C< ArClientBase,
ArNetPacket *, struct sockaddr_in * > 
myProcessPacketUdpCB
bool myQuiet
bool myReceivedArgRetList
bool myReceivedDataList
bool myReceivedGroupAndFlagsList
int myRejected
char myRejectedString [32000]
std::string myRobotName
 Optional robot name for logging.
std::string myServerKey
unsigned int myServerReportedUdpPort
unsigned int myServerSentUdpPort
std::list< ArFunctor * > myServerShutdownCBList
ArTime myStartedConnection
ClientState myState
ArMutex myStateMutex
ArTime myStateStarted
bool myTcpOnlyFrom
bool myTcpOnlyTo
ArNetPacketReceiverTcp myTcpReceiver
ArNetPacketSenderTcp myTcpSender
ArSocket myTcpSocket
int myTimeoutTime
std::map< unsigned int, Tracker * > myTrackingReceivedMap
std::map< unsigned int, Tracker * > myTrackingSentMap
ArTime myTrackingStarted
bool myUdpConfirmedFrom
bool myUdpConfirmedTo
unsigned int myUdpPort
ArNetPacketReceiverUdp myUdpReceiver
sockaddr_in myUdpSin
bool myUdpSinValid
ArSocket myUdpSocket
std::string myUser

Classes

class  Tracker

Detailed Description

The base client class.

You need to connect a client to a server using blockingConnect() with the address for the server. Then you should add handlers to the client to receive information from the server (with addHandler(), request(), and requestOnce()). Then call run() or runAsync() (or loopOnce() if you really know what you're doing). You can also add a callback that will get called every cycle of the client.

User and password information may be required by the server. For details on that see ArServerBase. The most important thing is the modification to blockingConnect(), it can now take a user and password argument and upon failure you'll want to check wasRejected() to determine whether the client couldn't find the server or if the user and password were rejected. Another relevant function is setServerKey() to set the key (string of text) we need to connect to the server.

This class should be thread safe... The only thing you cannot do is call 'addHandler' or 'remHandler' from within a handler for that specific piece of data.

Examples:

getVideoExample.cpp.

Definition at line 60 of file ArClientBase.h.


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
CLIENT_KEY_LENGTH 

Definition at line 76 of file ArClientBase.h.

enum ArClientBase::ClientState
 

The state of the connection.

Enumeration values:
STATE_NO_CONNECTION  The client has not connected.
STATE_FAILED_CONNECTION  The client tried to connect and failed.
STATE_OPENED_SOCKET  Client opened socket, waiting for intro from srvr.
STATE_EXCHANGED_INTROS  Client and server have exchanged introductions.
STATE_REJECTED  Client was rejected by server.
STATE_WAITING_LIST  Client was connected to server, waiting for list.
STATE_CONNECTED  Client is connected to server.
STATE_LOST_CONNECTION  Client lost connection to server.

Definition at line 65 of file ArClientBase.h.


Constructor & Destructor Documentation

ArClientBase::ArClientBase  ) 
 

Constructor.

Definition at line 41 of file ArClientBase.cpp.

References clear(), myProcessPacketCB, myProcessPacketUdpCB, myTcpReceiver, myTcpSender, myTcpSocket, myUdpReceiver, myUdpSocket, ArNetPacketReceiverUdp::setProcessPacketCB(), ArNetPacketReceiverTcp::setProcessPacketCB(), ArNetPacketReceiverUdp::setSocket(), ArNetPacketReceiverTcp::setSocket(), ArNetPacketSenderTcp::setSocket(), and ArThread::setThreadName().

ArClientBase::~ArClientBase  )  [virtual]
 

Destructor.

Definition at line 57 of file ArClientBase.cpp.

References clear().


Member Function Documentation

void ArClientBase::addCycleCallback ArFunctor functor  ) 
 

Adds a functor to call every cycle.

You cannot add a cycle callback from within a cycle or it will deadlock

Parameters:
functor callback to add

Definition at line 120 of file ArClientBase.cpp.

References ArMutex::lock(), myCycleCallbackMutex, myCycleCallbacks, and ArMutex::unlock().

Referenced by ArHybridForwarderVideo::finishConstructor().

void ArClientBase::addDisconnectOnErrorCB ArFunctor functor,
ArListPos::Pos  position = ArListPos::LAST
 

Adds a call for when a disconnection has occured because of error.

Parameters:
functor functor created from ArFunctorC which refers to the function to call.
position whether to place the functor first or last
See also:
remDisconnectOnErrorCB

Definition at line 1495 of file ArClientBase.cpp.

References ArMutex::lock(), ArLog::log(), myCallbackMutex, myDisconnectOnErrorCBList, and ArMutex::unlock().

bool ArClientBase::addHandler const char *  name,
ArFunctor1< ArNetPacket * > *  functor
 

Adds a functor for some particular data.

Note that if you try and add a handler for a specific piece of data from within a handler for that specific piece of data you'll deadlock.

Parameters:
name the name of the data to use with this functor
functor the functor to call with the packet when data with this name arrives
Returns:
false is returned if this name doesn't exist in the data

Python Wrapper Library: Pass a function taking one argument for

  • functor
Java Wrapper Library: Use a subclass of ArFunctor_NetPacket for the
  • functor object.
Examples:
getVideoExample.cpp.

Definition at line 1128 of file ArClientBase.cpp.

References ArClientData::addFunctor(), ArClientData::getFunctorList(), ArMutex::lock(), ArClientData::lockFunctorList(), ArLog::log(), myIntDataMap, myMapsMutex, myNameIntMap, ArMutex::unlock(), and ArClientData::unlockFunctorList().

Referenced by ArClientDeleteFileOnServer::ArClientDeleteFileOnServer(), ArClientFileFromClient::ArClientFileFromClient(), ArClientFileLister::ArClientFileLister(), ArClientFileToClient::ArClientFileToClient(), ArCentralForwarder::connectingCallOnce(), ArHybridForwarderVideo::finishConstructor(), main(), OutputHandler::OutputHandler(), ArClientHandlerConfig::requestConfigFromServer(), and ArClientSwitchManager::runThread().

void ArClientBase::addServerShutdownCB ArFunctor functor,
ArListPos::Pos  position = ArListPos::LAST
 

Adds a call for when the server shuts down.

Parameters:
functor functor created from ArFunctorC which refers to the function to call.
position whether to place the functor first or last
See also:
remServerShutdownCB

Definition at line 1527 of file ArClientBase.cpp.

References ArMutex::lock(), ArLog::log(), myCallbackMutex, myServerShutdownCBList, and ArMutex::unlock().

bool ArClientBase::blockingConnect const char *  host,
int  port,
bool  print = true,
const char *  user = NULL,
const char *  password = NULL
 

Connect to a server.

Parameters:
host the host to connect to
port the port to connect on
print whether to print out our connection information or not (you'll usually want to use the default argument of true, only here for some more advanced internal things), this carries over to things like disconnect printing too
user user name, or NULL for none.
password password (cleartext), or NULL for none.

Definition at line 182 of file ArClientBase.cpp.

References internalBlockingConnect().

Referenced by ArHybridForwarderVideo::ArHybridForwarderVideo(), ArClientSimpleConnector::connectClient(), main(), and ArClientSwitchManager::runThread().

void ArClientBase::buildList ArNetPacket packet  )  [protected]
 

Definition at line 893 of file ArClientBase.cpp.

References ArClientData::addDataFlags(), getName(), ArLog::log(), myIntDataMap, myNameIntMap, myReceivedArgRetList, myReceivedDataList, myReceivedGroupAndFlagsList, ArClientData::setArgRetDescs(), and ArClientData::setCommandGroup().

Referenced by processPacket().

void ArClientBase::clear void   )  [protected]
 

Definition at line 83 of file ArClientBase.cpp.

References ArUtil::deleteSetPairs(), internalSwitchState(), myIntDataMap, myLastPacketReceived, myNameIntMap, myQuiet, myReceivedArgRetList, myReceivedDataList, myReceivedGroupAndFlagsList, myRejected, myRejectedString, myServerReportedUdpPort, myTcpOnlyFrom, myTcpOnlyTo, myTimeoutTime, myUdpConfirmedFrom, myUdpConfirmedTo, resetTracking(), ArTime::setToNow(), and STATE_NO_CONNECTION.

Referenced by ArClientBase(), internalBlockingConnect(), ArCentralForwarder::~ArCentralForwarder(), and ~ArClientBase().

bool ArClientBase::dataExists const char *  name  ) 
 

Sees if this data exists.

Parameters:
name the name to stop sending

Definition at line 1448 of file ArClientBase.cpp.

References ArMutex::lock(), myDataMutex, myNameIntMap, and ArMutex::unlock().

Referenced by ArClientHandlerConfig::canRequestDefaults(), ArHybridForwarderVideo::finishConstructor(), ArClientDeleteFileOnServer::isAvailable(), ArClientFileFromClient::isAvailable(), ArClientFileToClient::isAvailable(), ArClientFileLister::isAvailable(), ArClientFileFromClient::isAvailableFast(), ArClientFileFromClient::isAvailableSlow(), main(), ArClientFileFromClient::putFileToDirectory(), ArClientHandlerConfig::requestConfigFromServer(), ArClientSwitchManager::runThread(), and InputHandler::sendInput().

bool ArClientBase::disconnect void   ) 
 

This method blocks while the connection is being shutdown.

Definition at line 446 of file ArClientBase.cpp.

References finishNonBlockingDisconnect(), ArUtil::sleep(), and startNonBlockingDisconnect().

Referenced by gotConfig(), processPacket(), ArClientSwitchManager::runThread(), and ArCentralForwarder::~ArCentralForwarder().

unsigned int ArClientBase::findCommandFromName const char *  name  ) 
 

Returns the command number from the name.

Parameters:
name the name of the data to find the command of
Returns:
0 if there is no command of that name, the command number otherwise

Definition at line 1217 of file ArClientBase.cpp.

References ArMutex::lock(), ArLog::log(), myMapsMutex, myNameIntMap, and ArMutex::unlock().

Referenced by request(), requestOnce(), requestOnceUdp(), and requestStop().

void ArClientBase::finishNonBlockingDisconnect  ) 
 

This method should be used in conjunction with startNonBlockingDisconnect in threads that should not block (such as the main GUI thread).

Definition at line 472 of file ArClientBase.cpp.

References ArSocket::close(), myState, myTcpSocket, myUdpSocket, and STATE_NO_CONNECTION.

Referenced by disconnect().

void ArClientBase::getClientKey unsigned char  key[CLIENT_KEY_LENGTH]  ) 
 

Gets a (probably) unique key that can be used to identify the client (after connection).

int ArClientBase::getConnectTimeoutTime void   ) 
 

Gets the time allowed for connection.

Returns:
This value controls how long the client will give to connect, it is the argument in number of seconds... if <= 0 then no timeout will take place.

Definition at line 162 of file ArClientBase.cpp.

References myTimeoutTime.

const std::map<unsigned int, ArClientData *>* ArClientBase::getDataMap void   )  [inline]
 

Internal function get get the data map.

Definition at line 251 of file ArClientBase.h.

References myIntDataMap.

Referenced by ArCentralForwarder::connectingCallOnce().

const char * ArClientBase::getHost void   ) 
 

Gets the name of the host we tried to connect to.

Definition at line 1637 of file ArClientBase.cpp.

References ArMutex::lock(), myDataMutex, myHost, and ArMutex::unlock().

Referenced by main().

ArTime ArClientBase::getLastPacketReceived void   ) 
 

Gets the last time a packet was received.

Definition at line 1589 of file ArClientBase.cpp.

References ArMutex::lock(), myDataMutex, myLastPacketReceived, and ArMutex::unlock().

const char * ArClientBase::getName unsigned int  command,
bool  internalCall = false
 

Gets the name of the data a command is.

Definition at line 1604 of file ArClientBase.cpp.

References ArMutex::lock(), myDataMutex, myIntDataMap, and ArMutex::unlock().

const char * ArClientBase::getName ArNetPacket packet,
bool  internalCall = false
 

Gets the name of the data a packet is for.

Definition at line 1598 of file ArClientBase.cpp.

Referenced by buildList(), logTracking(), ArCentralForwarder::receiveData(), ArCentralForwarder::requestChanged(), and ArCentralForwarder::requestOnce().

bool ArClientBase::getReceivedArgRetList void   )  [inline]
 

Gets if we received the list of arguments and.

Definition at line 270 of file ArClientBase.h.

References myReceivedArgRetList.

Referenced by ArCentralForwarder::connectingCallOnce().

bool ArClientBase::getReceivedDataList void   )  [inline]
 

Gets if we received the list of commands.

Definition at line 268 of file ArClientBase.h.

References myReceivedDataList.

Referenced by ArCentralForwarder::connectingCallOnce().

bool ArClientBase::getReceivedGroupAndFlagsList void   )  [inline]
 

Gets if we received the list of commands.

Definition at line 272 of file ArClientBase.h.

References myReceivedGroupAndFlagsList.

Referenced by ArCentralForwarder::connectingCallOnce().

int ArClientBase::getRejected void   )  [inline]
 

Tells us the reason the connection was rejected (see ArServerCommands for details).

Definition at line 274 of file ArClientBase.h.

References myRejected.

const char* ArClientBase::getRejectedString void   )  [inline]
 

Tells us the reason the connection was rejected (see ArServerCommands for details).

Definition at line 276 of file ArClientBase.h.

References myRejectedString.

const char * ArClientBase::getRobotName  )  const [virtual]
 

Returns the optional name of the connected robot for debugging purposes.

Definition at line 77 of file ArClientBase.cpp.

References myRobotName.

struct in_addr* ArClientBase::getTcpAddr void   )  [inline]
 

Internal function to get the socket (no one should need this).

Definition at line 241 of file ArClientBase.h.

References ArSocket::inAddr(), and myTcpSocket.

ArSocket* ArClientBase::getTcpSocket void   )  [inline]
 

Internal function to get the tcp socket.

Definition at line 247 of file ArClientBase.h.

References myTcpSocket.

Referenced by ArClientSwitchManager::clientSwitch(), ArCentralManager::netClientList(), ArCentralManager::netServerSwitch(), and ArCentralManager::runThread().

ArSocket* ArClientBase::getUdpSocket void   )  [inline]
 

Internal function to get the udp socket.

Definition at line 249 of file ArClientBase.h.

References myUdpSocket.

bool ArClientBase::internalBlockingConnect const char *  host,
int  port,
bool  print,
const char *  user,
const char *  password,
ArSocket tcpSocket
 

Internal function that'll do the connection (mainly for switch connections).

Definition at line 189 of file ArClientBase.cpp.

References clear(), ArSocket::close(), ArNetPacket::empty(), internalConnect(), internalStartUdp(), internalSwitchState(), ArMutex::lock(), ArLog::log(), loopOnce(), ArTime::mSecSince(), myDataMutex, myHost, myPassword, myQuiet, myStartedConnection, myState, myTcpOnlyFrom, myTcpOnlyTo, myTcpReceiver, myTcpSocket, myTimeoutTime, myUdpConfirmedFrom, myUdpConfirmedTo, myUdpSocket, myUser, sendPacketTcp(), ArNetPacket::setCommand(), ArNetPacketReceiverTcp::setQuiet(), ArTime::setToNow(), ArUtil::sleep(), STATE_CONNECTED, STATE_FAILED_CONNECTION, STATE_LOST_CONNECTION, STATE_NO_CONNECTION, STATE_OPENED_SOCKET, STATE_REJECTED, ArSocket::transfer(), and ArMutex::unlock().

Referenced by blockingConnect(), and ArCentralForwarder::startingCallOnce().

bool ArClientBase::internalConnect const char *  host,
int  port,
bool  obsolete
[protected]
 

Definition at line 382 of file ArClientBase.cpp.

References ArSocket::connect(), internalStartUdp(), internalSwitchState(), ArLog::log(), myQuiet, myTcpSocket, myUdpPort, ArSocket::setNonBlock(), STATE_FAILED_CONNECTION, and STATE_OPENED_SOCKET.

Referenced by internalBlockingConnect().

void ArClientBase::internalStartUdp void   )  [protected]
 

Definition at line 424 of file ArClientBase.cpp.

References ArSocket::create(), ArSocket::findValidPort(), ArSocket::inAddr(), ArSocket::inPort(), ArLog::log(), myQuiet, myTcpOnlyFrom, myTcpOnlyTo, myTcpSocket, myUdpPort, myUdpSin, myUdpSinValid, myUdpSocket, ArSocket::netToHostOrder(), ArSocket::setLinger(), and ArSocket::setNonBlock().

Referenced by internalBlockingConnect(), and internalConnect().

void ArClientBase::internalSwitchState ClientState  state  )  [protected]
 

Definition at line 1104 of file ArClientBase.cpp.

References myState, myStateStarted, and ArTime::setToNow().

Referenced by clear(), internalBlockingConnect(), internalConnect(), loopOnce(), and processPacket().

bool ArClientBase::isConnected void   )  [inline]
 

true if we're connected to a server

Definition at line 122 of file ArClientBase.h.

References myState, and STATE_CONNECTED.

Referenced by ArCentralForwarder::connectedCallOnce(), ArHybridForwarderVideo::finishConstructor(), and ArCentralForwarder::~ArCentralForwarder().

bool ArClientBase::isTcpOnlyFromServer void   ) 
 

Returns whether we only get TCP data from the server not UDP.

Definition at line 1570 of file ArClientBase.cpp.

References ArMutex::lock(), myDataMutex, myTcpOnlyFrom, and ArMutex::unlock().

bool ArClientBase::isTcpOnlyToServer void   ) 
 

Returns whether we only send TCP data to the server.

Definition at line 1579 of file ArClientBase.cpp.

References ArMutex::lock(), myDataMutex, myTcpOnlyTo, and ArMutex::unlock().

void ArClientBase::logDataList void   ) 
 

Print out or data with descriptions.

Definition at line 1457 of file ArClientBase.cpp.

References ArClientData::getArgumentDescription(), ArClientData::getCommand(), ArClientData::getCommandGroup(), ArClientData::getDataFlagsString(), ArClientData::getDescription(), ArClientData::getFunctorList(), ArClientData::getName(), ArClientData::getReturnDescription(), ArMutex::lock(), ArLog::log(), myDataMutex, myIntDataMap, and ArMutex::unlock().

Referenced by ArClientSimpleConnector::connectClient(), InputHandler::listData(), and main().

void ArClientBase::logTracking bool  terse  ) 
 

Logs the tracking information (packet and byte counts).

Definition at line 1688 of file ArClientBase.cpp.

References ArSocket::getBytesRecvd(), ArSocket::getBytesSent(), getName(), ArSocket::getRecvs(), ArSocket::getSends(), ArMutex::lock(), ArLog::log(), ArClientBase::Tracker::myBytesTcp, ArClientBase::Tracker::myBytesUdp, myDataMutex, ArClientBase::Tracker::myPacketsTcp, ArClientBase::Tracker::myPacketsUdp, myPacketTrackingMutex, myTcpSocket, myTrackingReceivedMap, myTrackingSentMap, myTrackingStarted, myUdpSocket, ArTime::secSince(), and ArMutex::unlock().

Referenced by InputHandler::logTrackingTerse(), and InputHandler::logTrackingVerbose().

void ArClientBase::loopOnce void   ) 
 

Run the loop once.

Definition at line 525 of file ArClientBase.cpp.

References ArSocket::close(), internalSwitchState(), ArMutex::lock(), ArLog::log(), myCallbackMutex, myCycleCallbackMutex, myCycleCallbacks, myDisconnectOnErrorCBList, myQuiet, myState, myTcpOnlyFrom, myTcpReceiver, myTcpSender, myTcpSocket, myUdpReceiver, myUdpSocket, ArNetPacketReceiverUdp::readData(), ArNetPacketReceiverTcp::readData(), ArNetPacketSenderTcp::sendData(), STATE_FAILED_CONNECTION, STATE_LOST_CONNECTION, STATE_NO_CONNECTION, ArASyncTask::stopRunning(), and ArMutex::unlock().

Referenced by ArCentralForwarder::connectedCallOnce(), ArCentralForwarder::connectingCallOnce(), gotConfig(), internalBlockingConnect(), and runThread().

void ArClientBase::processPacket ArNetPacket packet,
bool  tcp
 

Process the packet wherever it came from.

see if we've opened the socket and this is an intro

Definition at line 601 of file ArClientBase.cpp.

References buildList(), ArBasePacket::dataToBuf(), disconnect(), ArNetPacket::empty(), ArClientData::getFunctorList(), ArUtil::getTime(), ArSocket::hostToNetOrder(), internalSwitchState(), ArFunctor1< P1 >::invoke(), ArMutex::lock(), ArClientData::lockFunctorList(), ArLog::log(), md5_append(), md5_finish(), md5_init(), myAuthKey, myCallbackMutex, myClientKey, myDataMutex, myIntDataMap, myIntroKey, myLastPacketReceived, myMapsMutex, myPassword, myQuiet, myRejected, myRejectedString, myServerKey, myServerReportedUdpPort, myServerShutdownCBList, myState, myTcpOnlyFrom, myTcpOnlyTo, myUdpConfirmedTo, myUdpPort, myUdpSin, myUser, ArMath::random(), sendPacketTcp(), sendPacketUdp(), ArNetPacket::setCommand(), ArTime::setToNow(), STATE_CONNECTED, STATE_EXCHANGED_INTROS, STATE_LOST_CONNECTION, STATE_OPENED_SOCKET, STATE_REJECTED, STATE_WAITING_LIST, ArASyncTask::stopRunning(), ArBasePacket::strToBuf(), trackPacketReceived(), ArBasePacket::uByte2ToBuf(), ArBasePacket::uByte4ToBuf(), ArMutex::unlock(), and ArClientData::unlockFunctorList().

Referenced by ArServerBase::processPacket(), and processPacketUdp().

void ArClientBase::processPacketUdp ArNetPacket packet,
struct sockaddr_in *  sin
 

Process a packet from udp (just hands off to processPacket).

Definition at line 1032 of file ArClientBase.cpp.

References ArNetPacket::empty(), ArMutex::lock(), ArLog::log(), myDataMutex, myIntroKey, myLastPacketReceived, myQuiet, myServerReportedUdpPort, myState, myUdpConfirmedFrom, myUdpSin, processPacket(), sendPacketTcp(), ArNetPacket::setCommand(), ArTime::setToNow(), STATE_CONNECTED, STATE_EXCHANGED_INTROS, STATE_WAITING_LIST, and ArMutex::unlock().

void ArClientBase::remCycleCallback ArFunctor functor  ) 
 

Removes a functor called every cycle.

Parameters:
functor callback to remove

Definition at line 134 of file ArClientBase.cpp.

References ArMutex::lock(), myCycleCallbackMutex, myCycleCallbacks, and ArMutex::unlock().

void ArClientBase::remDisconnectOnErrorCB ArFunctor functor  ) 
 

Removes a call for when a disconnection has occured because of error.

Parameters:
functor the functor to remove from the list of connect callbacks
See also:
addDisconnectOnErrorCB

Definition at line 1513 of file ArClientBase.cpp.

References ArMutex::lock(), myCallbackMutex, myDisconnectOnErrorCBList, and ArMutex::unlock().

bool ArClientBase::remHandler const char *  name,
ArFunctor1< ArNetPacket * > *  functor
 

Removes a functor for some particular data by name.

Note that if you try and remove a handler for a specific piece of data from within a handler for that specific piece of data you'll deadlock.

Parameters:
name the name of the data to use with this functor
functor the functor to call with the packet when data with this name arrives
Returns:
false is returned if this name doesn't exist in the data

Definition at line 1184 of file ArClientBase.cpp.

References ArMutex::lock(), ArClientData::lockFunctorList(), ArLog::log(), myIntDataMap, myMapsMutex, myNameIntMap, ArClientData::remFunctor(), ArMutex::unlock(), and ArClientData::unlockFunctorList().

Referenced by ArClientHandlerConfig::requestConfigFromServer().

void ArClientBase::remServerShutdownCB ArFunctor functor  ) 
 

Removes a call for when the server shuts down.

Parameters:
functor the functor to remove from the list of connect callbacks
See also:
addServerShutdownCB

Definition at line 1545 of file ArClientBase.cpp.

References ArMutex::lock(), myCallbackMutex, myServerShutdownCBList, and ArMutex::unlock().

bool ArClientBase::request const char *  name,
long  mSec,
ArNetPacket packet = NULL
 

Request some data every mSec milliseconds.

Parameters:
name the name of the data to request
mSec the number of milliseconds we want a refresh on this data, if this number is 0 then the server will send the information as often as it is available; if -1, then the server will send the information only when it changes (for broadcast type packets)
packet the packet that contains the data to use as argument
Examples:
getVideoExample.cpp.

Definition at line 1250 of file ArClientBase.cpp.

References findCommandFromName(), ArLog::log(), myLogPrefix, and requestByCommand().

Referenced by ArCentralForwarder::connectingCallOnce(), main(), and OutputHandler::OutputHandler().

bool ArClientBase::requestByCommand unsigned int  command,
long  mSec,
ArNetPacket packet = NULL
 

Request some data every mSec milliseconds by command not name.

Parameters:
command the command number of the data to request
mSec the number of milliseconds we want a refresh on this data, if this number is 0 then the server will send the information as often as it is available; if -1, then the server will send the information only when it changes (for broadcast type packets)
packet the packet that contains the data to use as argument

Definition at line 1273 of file ArClientBase.cpp.

References ArBasePacket::byte4ToBuf(), ArBasePacket::dataToBuf(), ArNetPacket::resetRead(), sendPacketTcp(), ArNetPacket::setCommand(), and ArBasePacket::uByte2ToBuf().

Referenced by request(), and ArCentralForwarder::requestChanged().

bool ArClientBase::requestOnce const char *  name,
ArNetPacket packet = NULL,
bool  quiet = false
 

Request some data (or send a command) just once.

this is useful for things like video data that you don't want to clog up the bandwidth with... its also useful for things like sending commands

Parameters:
name the name of the data to request
packet the packet that contains the data to use as argument
quiet a bool set to true to override the verbose logging of this method (generally for repeating requests); default is false to log.
Examples:
getVideoExample.cpp.

Definition at line 1325 of file ArClientBase.cpp.

References findCommandFromName(), ArLog::log(), myLogPrefix, and requestOnceByCommand().

Referenced by ArClientFileFromClient::cancelPut(), ArHybridForwarderVideo::clientCycleCallback(), ArClientDeleteFileOnServer::deleteFileFromDirectory(), ArHybridForwarderVideo::finishConstructor(), ArClientFileToClient::getFileFromDirectory(), main(), OutputHandler::OutputHandler(), ArClientFileFromClient::putFileToDirectory(), ArClientHandlerConfig::reloadConfigOnServer(), ArClientHandlerConfig::requestConfigDefaults(), ArClientHandlerConfig::requestConfigFromServer(), ArClientHandlerConfig::requestDefaultConfigFromServer(), ArClientSwitchManager::runThread(), InputHandler::safeDrive(), ArClientHandlerConfig::saveConfigToServer(), InputHandler::sendInput(), and InputHandler::unsafeDrive().

bool ArClientBase::requestOnceByCommand unsigned int  command,
ArNetPacket packet = NULL
 

Request some data (or send a command) just once by command not name.

this is useful for things like video data that you don't want to clog up the bandwidth with... its also useful for things like sending commands

Parameters:
command the command number to request
packet the packet that contains the data to use as argument

Definition at line 1364 of file ArClientBase.cpp.

References sendPacketTcp(), and ArNetPacket::setCommand().

Referenced by ArCentralForwarder::requestChanged(), requestOnce(), and ArCentralForwarder::requestOnce().

bool ArClientBase::requestOnceByCommandUdp unsigned int  command,
ArNetPacket packet = NULL
 

Request some data (or send a command) just once by command not name.

this is useful for things like video data that you don't want to clog up the bandwidth with... its also useful for things like sending commands

Parameters:
command the command number to request
packet the packet that contains the data to use as argument

Definition at line 1389 of file ArClientBase.cpp.

References myTcpOnlyTo, sendPacketTcp(), sendPacketUdp(), and ArNetPacket::setCommand().

Referenced by requestOnceUdp().

bool ArClientBase::requestOnceUdp const char *  name,
ArNetPacket packet = NULL
 

Request some data (or send a command) just once by UDP.

this is useful for things like video data that you don't want to clog up the bandwidth with... its also useful for things like sending commands... Note that this version goes over UDP. This means you CANNOT assume it will get there or that you will get a response...

Parameters:
name the name of the data to request
packet the packet that contains the data to use as argument

Definition at line 1346 of file ArClientBase.cpp.

References findCommandFromName(), ArLog::log(), myLogPrefix, and requestOnceByCommandUdp().

bool ArClientBase::requestOnceWithString const char *  name,
const char *  str
 

Request some data (or send a command) just once with a string as argument.

this is useful for things like video data that you don't want to clog up the bandwidth with... its also useful for things like sending commands

Parameters:
name the name of the data to request
str a string to send as the packet argument

Definition at line 1420 of file ArClientBase.cpp.

References ArMutex::lock(), ArLog::log(), myDataMutex, myLogPrefix, myNameIntMap, sendPacketTcp(), ArNetPacket::setCommand(), ArBasePacket::strToBuf(), and ArMutex::unlock().

Referenced by ArClientFileLister::changeToAbsDir(), ArClientFileLister::changeToDir(), ArClientFileLister::changeToTopDir(), ArClientHandlerConfig::requestSectionDefaults(), and ArClientFileLister::upOneDir().

bool ArClientBase::requestStop const char *  name  ) 
 

Don't want this data anymore.

Parameters:
name the name to stop sending

Definition at line 1294 of file ArClientBase.cpp.

References findCommandFromName(), ArLog::log(), myLogPrefix, and requestStopByCommand().

Referenced by OutputHandler::~OutputHandler().

bool ArClientBase::requestStopByCommand unsigned int  command  ) 
 

Don't want this data anymore, by command not name.

Parameters:
command the command number to stop

Definition at line 1305 of file ArClientBase.cpp.

References sendPacketTcp(), ArNetPacket::setCommand(), and ArBasePacket::uByte2ToBuf().

Referenced by ArCentralForwarder::requestChanged(), and requestStop().

void ArClientBase::resetTracking void   ) 
 

Clears the tracking information (resets counters).

Definition at line 1867 of file ArClientBase.cpp.

References ArMutex::lock(), myPacketTrackingMutex, myTcpSocket, myTrackingReceivedMap, myTrackingSentMap, myTrackingStarted, myUdpSocket, ArSocket::resetTracking(), ArTime::setToNow(), and ArMutex::unlock().

Referenced by clear(), and InputHandler::resetTracking().

void ArClientBase::run void   )  [virtual]
 

Runs the client in this thread.

Reimplemented from ArASyncTask.

Examples:
getVideoExample.cpp.

Definition at line 579 of file ArClientBase.cpp.

References ArASyncTask::runInThisThread().

Referenced by main().

void ArClientBase::runAsync void   )  [virtual]
 

Runs the client in its own thread.

Reimplemented from ArASyncTask.

Definition at line 584 of file ArClientBase.cpp.

References ArASyncTask::create().

Referenced by ArHybridForwarderVideo::ArHybridForwarderVideo(), main(), and ArClientSwitchManager::runThread().

void * ArClientBase::runThread void *  arg  )  [virtual]
 

Implements ArASyncTask.

Definition at line 589 of file ArClientBase.cpp.

References loopOnce(), ArUtil::sleep(), and ArThread::threadStarted().

bool ArClientBase::sendPacketTcp ArNetPacket packet  ) 
 

Send a packet over TCP.

Definition at line 490 of file ArClientBase.cpp.

References myTcpSender, ArNetPacketSenderTcp::sendPacket(), setupPacket(), and trackPacketSent().

Referenced by ArServerInfoRobot::activityTimeInfo(), ArServerInfoRobot::batteryInfo(), ArServerDeleteFileOnServer::deleteFile(), ArServerHandlerCameraCollection::getCameraList(), ArServerHandlerConfig::getConfigDefaults(), ArServerHandlerConfig::getConfigSectionFlags(), ArServerFileLister::getDirListing(), ArServerFileToClient::getFile(), ArServerMode::getModeDataList(), ArServerMode::getModeInfo(), ArServerHandlerCommMonitor::handleAckCommTcp(), ArServerHandlerCamera::handleCameraModeUpdated(), ArServerHandlerCamera::handleGetCameraModeList(), ArServerHandlerConfig::handleGetConfig(), ArServerHandlerCommMonitor::handleGetHeartbeatInterval(), internalBlockingConnect(), ArServerFileFromClient::internalPutFile(), ArServerHandlerConfig::internalSetConfig(), ArClientSwitchManager::netCentralHeartbeat(), ArCentralManager::netClientList(), ArServerInfoDrawings::netGetDrawingList(), ArServerInfoStrings::netGetStrings(), ArServerInfoStrings::netGetStringsInfo(), ArServerHandlerCommands::netListCommands(), ArServerInfoDrawings::netListDrawings(), ArServerHandlerCommands::netListStringCommands(), ArCentralManager::netServerSwitch(), ArServerInfoRobot::physicalInfo(), processPacket(), processPacketUdp(), ArCentralForwarder::receiveData(), requestByCommand(), requestOnceByCommand(), requestOnceByCommandUdp(), requestOnceWithString(), requestStopByCommand(), ArHybridForwarderVideo::sendVideoSize(), ArServerHandlerMap::serverGetGoals(), ArServerHandlerMap::serverGetMap(), ArServerHandlerMap::serverGetMapBinary(), ArServerHandlerMap::serverGetMapName(), ArServerModeRatioDrive::serverGetSafeDrive(), ArServerHandlerMapping::serverMappingEnd(), ArServerHandlerMapping::serverMappingStart(), ArServerHandlerMapping::serverMappingStatus(), ArServerHandlerCameraCollection::setParams(), setTcpOnlyFromServer(), startNonBlockingDisconnect(), ArServerHandlerMap::writeLinesToClient(), ArServerHandlerMap::writeMapToClient(), and ArServerHandlerMap::writePointsToClient().

bool ArClientBase::sendPacketUdp ArNetPacket packet  ) 
 

Send a packet over UDP (unless client only wants tcp then sends over tcp).

Examples:
drawingsExampleWithRobot.cpp.

Definition at line 504 of file ArClientBase.cpp.

References myUdpSin, myUdpSocket, ArSocket::sendTo(), setupPacket(), and trackPacketSent().

Referenced by ArServerHandlerCamera::cameraInfo(), ArServerHandlerCamera::cameraUpdate(), exampleArrowsDrawingNetCallback(), exampleDotsDrawingNetCallback(), exampleHomeDrawingNetCallback(), exampleXDrawingNetCallback(), ArServerInfoSensor::getSensorCumulative(), ArServerInfoSensor::getSensorCurrent(), ArServerInfoSensor::getSensorList(), ArServerHandlerCommMonitor::handleAckCommUdp(), ArServerHandlerCamera::handleGetCameraData(), ArServerHandlerCamera::handleGetCameraInfo(), ArClientSwitchManager::netCentralHeartbeat(), ArServerInfoDrawings::netRangeDeviceCumulative(), ArServerInfoDrawings::netRangeDeviceCurrent(), processPacket(), ArCentralForwarder::receiveData(), requestOnceByCommandUdp(), ArHybridForwarderVideo::sendVideo(), and ArServerInfoRobot::update().

void ArClientBase::setConnectTimeoutTime int  sec  ) 
 

Sets the time to allow for connection (default 3).

Parameters:
sec This value controls how long the client will give to connect, it is the argument in number of seconds... if <= 0 then no timeout will take place.

Definition at line 147 of file ArClientBase.cpp.

References ArMutex::lock(), myDataMutex, myTimeoutTime, and ArMutex::unlock().

Referenced by ArHybridForwarderVideo::ArHybridForwarderVideo().

void ArClientBase::setRobotName const char *  name  )  [virtual]
 

Sets the optional name of the connected robot for debugging purposes.

Parameters:
name an optional char * name of the connected robot to be used in the log messages

Definition at line 67 of file ArClientBase.cpp.

References myLogPrefix, and myRobotName.

void ArClientBase::setServerKey const char *  serverKey,
bool  print = true
 

Sets the 'key' needed to connect to the server.

Definition at line 1620 of file ArClientBase.cpp.

References ArMutex::lock(), ArLog::log(), myDataMutex, myServerKey, and ArMutex::unlock().

Referenced by ArClientSimpleConnector::connectClient(), and ArClientSwitchManager::runThread().

void ArClientBase::setTcpOnlyFromServer void   ) 
 

Sets it so we only get TCP data from the server not UDP.

Definition at line 1552 of file ArClientBase.cpp.

References ArMutex::lock(), myDataMutex, myTcpOnlyFrom, sendPacketTcp(), ArNetPacket::setCommand(), and ArMutex::unlock().

void ArClientBase::setTcpOnlyToServer void   ) 
 

Sets it so we only send TCP data to the server.

Definition at line 1563 of file ArClientBase.cpp.

References ArMutex::lock(), myDataMutex, myTcpOnlyTo, and ArMutex::unlock().

bool ArClientBase::setupPacket ArNetPacket packet  )  [protected]
 

Definition at line 481 of file ArClientBase.cpp.

References myState, STATE_FAILED_CONNECTION, and STATE_NO_CONNECTION.

Referenced by sendPacketTcp(), and sendPacketUdp().

bool ArClientBase::startNonBlockingDisconnect  ) 
 

This method should be called in threads that should not block (such as the main GUI thread).

The call should be followed by a delay of one second, followed by a call to finishNonBlockingDisconnect().

Definition at line 457 of file ArClientBase.cpp.

References ArLog::log(), myQuiet, myTcpSender, ArNetPacketSenderTcp::sendData(), sendPacketTcp(), and ArNetPacket::setCommand().

Referenced by disconnect().

void ArClientBase::trackPacketReceived ArNetPacket packet,
bool  tcp
[protected]
 

Definition at line 1665 of file ArClientBase.cpp.

References ArMutex::lock(), myPacketTrackingMutex, myTrackingReceivedMap, and ArMutex::unlock().

Referenced by processPacket().

void ArClientBase::trackPacketSent ArNetPacket packet,
bool  tcp
[protected]
 

Definition at line 1646 of file ArClientBase.cpp.

References ArMutex::lock(), myPacketTrackingMutex, myTrackingSentMap, and ArMutex::unlock().

Referenced by sendPacketTcp(), and sendPacketUdp().

bool ArClientBase::wasRejected void   )  [inline]
 

true if a server connection attempt failed because the server rejected the username or password, false if the connection failed for another reason, or the username/password were accepted.

Definition at line 125 of file ArClientBase.h.

References myState, and STATE_REJECTED.

Referenced by main(), and ArClientSwitchManager::runThread().


Member Data Documentation

long ArClientBase::myAuthKey [protected]
 

Definition at line 335 of file ArClientBase.h.

Referenced by processPacket().

ArMutex ArClientBase::myCallbackMutex [protected]
 

Definition at line 320 of file ArClientBase.h.

Referenced by addDisconnectOnErrorCB(), addServerShutdownCB(), loopOnce(), processPacket(), remDisconnectOnErrorCB(), and remServerShutdownCB().

unsigned char ArClientBase::myClientKey[16] [protected]
 

Definition at line 339 of file ArClientBase.h.

Referenced by processPacket().

ArMutex ArClientBase::myClientMutex [protected]
 

Definition at line 317 of file ArClientBase.h.

ArMutex ArClientBase::myCycleCallbackMutex [protected]
 

Definition at line 321 of file ArClientBase.h.

Referenced by addCycleCallback(), loopOnce(), and remCycleCallback().

std::list<ArFunctor *> ArClientBase::myCycleCallbacks [protected]
 

Definition at line 288 of file ArClientBase.h.

Referenced by addCycleCallback(), loopOnce(), and remCycleCallback().

ArMutex ArClientBase::myDataMutex [protected]
 

Definition at line 316 of file ArClientBase.h.

Referenced by dataExists(), getHost(), getLastPacketReceived(), getName(), internalBlockingConnect(), isTcpOnlyFromServer(), isTcpOnlyToServer(), logDataList(), logTracking(), processPacket(), processPacketUdp(), requestOnceWithString(), setConnectTimeoutTime(), setServerKey(), setTcpOnlyFromServer(), and setTcpOnlyToServer().

std::list<ArFunctor *> ArClientBase::myDisconnectOnErrorCBList [protected]
 

Definition at line 287 of file ArClientBase.h.

Referenced by addDisconnectOnErrorCB(), loopOnce(), and remDisconnectOnErrorCB().

std::string ArClientBase::myHost [protected]
 

Definition at line 308 of file ArClientBase.h.

Referenced by getHost(), and internalBlockingConnect().

std::map<unsigned int, ArClientData *> ArClientBase::myIntDataMap [protected]
 

Definition at line 326 of file ArClientBase.h.

Referenced by addHandler(), buildList(), clear(), getDataMap(), getName(), logDataList(), processPacket(), and remHandler().

long ArClientBase::myIntroKey [protected]
 

Definition at line 336 of file ArClientBase.h.

Referenced by processPacket(), and processPacketUdp().

ArTime ArClientBase::myLastPacketReceived [protected]
 

Definition at line 285 of file ArClientBase.h.

Referenced by clear(), getLastPacketReceived(), processPacket(), and processPacketUdp().

std::string ArClientBase::myLogPrefix [protected]
 

Optional prefix to be inserted at the start of log messages.

Definition at line 282 of file ArClientBase.h.

Referenced by request(), requestOnce(), requestOnceUdp(), requestOnceWithString(), requestStop(), and setRobotName().

ArMutex ArClientBase::myMapsMutex [protected]
 

Definition at line 318 of file ArClientBase.h.

Referenced by addHandler(), findCommandFromName(), processPacket(), and remHandler().

std::map<std::string, unsigned int> ArClientBase::myNameIntMap [protected]
 

Definition at line 324 of file ArClientBase.h.

Referenced by addHandler(), buildList(), clear(), dataExists(), findCommandFromName(), remHandler(), and requestOnceWithString().

ArMutex ArClientBase::myPacketTrackingMutex [protected]
 

Definition at line 322 of file ArClientBase.h.

Referenced by logTracking(), resetTracking(), trackPacketReceived(), and trackPacketSent().

std::string ArClientBase::myPassword [protected]
 

Definition at line 310 of file ArClientBase.h.

Referenced by internalBlockingConnect(), and processPacket().

ArFunctor2C<ArClientBase, ArNetPacket *, bool> ArClientBase::myProcessPacketCB [protected]
 

Definition at line 345 of file ArClientBase.h.

Referenced by ArClientBase().

ArFunctor2C<ArClientBase, ArNetPacket *, struct sockaddr_in *> ArClientBase::myProcessPacketUdpCB [protected]
 

Definition at line 346 of file ArClientBase.h.

Referenced by ArClientBase().

bool ArClientBase::myQuiet [protected]
 

Definition at line 307 of file ArClientBase.h.

Referenced by clear(), internalBlockingConnect(), internalConnect(), internalStartUdp(), loopOnce(), processPacket(), processPacketUdp(), and startNonBlockingDisconnect().

bool ArClientBase::myReceivedArgRetList [protected]
 

Definition at line 296 of file ArClientBase.h.

Referenced by buildList(), clear(), and getReceivedArgRetList().

bool ArClientBase::myReceivedDataList [protected]
 

Definition at line 295 of file ArClientBase.h.

Referenced by buildList(), clear(), and getReceivedDataList().

bool ArClientBase::myReceivedGroupAndFlagsList [protected]
 

Definition at line 297 of file ArClientBase.h.

Referenced by buildList(), clear(), and getReceivedGroupAndFlagsList().

int ArClientBase::myRejected [protected]
 

Definition at line 348 of file ArClientBase.h.

Referenced by clear(), getRejected(), and processPacket().

char ArClientBase::myRejectedString[32000] [protected]
 

Definition at line 349 of file ArClientBase.h.

Referenced by clear(), getRejectedString(), and processPacket().

std::string ArClientBase::myRobotName [protected]
 

Optional robot name for logging.

Definition at line 280 of file ArClientBase.h.

Referenced by getRobotName(), and setRobotName().

std::string ArClientBase::myServerKey [protected]
 

Definition at line 337 of file ArClientBase.h.

Referenced by processPacket(), and setServerKey().

unsigned int ArClientBase::myServerReportedUdpPort [protected]
 

Definition at line 331 of file ArClientBase.h.

Referenced by clear(), processPacket(), and processPacketUdp().

unsigned int ArClientBase::myServerSentUdpPort [protected]
 

Definition at line 333 of file ArClientBase.h.

std::list<ArFunctor *> ArClientBase::myServerShutdownCBList [protected]
 

Definition at line 286 of file ArClientBase.h.

Referenced by addServerShutdownCB(), processPacket(), and remServerShutdownCB().

ArTime ArClientBase::myStartedConnection [protected]
 

Definition at line 314 of file ArClientBase.h.

Referenced by internalBlockingConnect().

ClientState ArClientBase::myState [protected]
 

Definition at line 298 of file ArClientBase.h.

Referenced by finishNonBlockingDisconnect(), internalBlockingConnect(), internalSwitchState(), isConnected(), loopOnce(), processPacket(), processPacketUdp(), setupPacket(), and wasRejected().

ArMutex ArClientBase::myStateMutex [protected]
 

Definition at line 319 of file ArClientBase.h.

ArTime ArClientBase::myStateStarted [protected]
 

Definition at line 299 of file ArClientBase.h.

Referenced by internalSwitchState().

bool ArClientBase::myTcpOnlyFrom [protected]
 

Definition at line 305 of file ArClientBase.h.

Referenced by clear(), internalBlockingConnect(), internalStartUdp(), isTcpOnlyFromServer(), loopOnce(), processPacket(), and setTcpOnlyFromServer().

bool ArClientBase::myTcpOnlyTo [protected]
 

Definition at line 303 of file ArClientBase.h.

Referenced by clear(), internalBlockingConnect(), internalStartUdp(), isTcpOnlyToServer(), processPacket(), requestOnceByCommandUdp(), and setTcpOnlyToServer().

ArNetPacketReceiverTcp ArClientBase::myTcpReceiver [protected]
 

Definition at line 341 of file ArClientBase.h.

Referenced by ArClientBase(), internalBlockingConnect(), and loopOnce().

ArNetPacketSenderTcp ArClientBase::myTcpSender [protected]
 

Definition at line 340 of file ArClientBase.h.

Referenced by ArClientBase(), loopOnce(), sendPacketTcp(), and startNonBlockingDisconnect().

ArSocket ArClientBase::myTcpSocket [protected]
 

Definition at line 343 of file ArClientBase.h.

Referenced by ArClientBase(), finishNonBlockingDisconnect(), getTcpAddr(), getTcpSocket(), internalBlockingConnect(), internalConnect(), internalStartUdp(), logTracking(), loopOnce(), and resetTracking().

int ArClientBase::myTimeoutTime [protected]
 

Definition at line 312 of file ArClientBase.h.

Referenced by clear(), getConnectTimeoutTime(), internalBlockingConnect(), and setConnectTimeoutTime().

std::map<unsigned int, Tracker *> ArClientBase::myTrackingReceivedMap [protected]
 

Definition at line 367 of file ArClientBase.h.

Referenced by logTracking(), resetTracking(), and trackPacketReceived().

std::map<unsigned int, Tracker *> ArClientBase::myTrackingSentMap [protected]
 

Definition at line 366 of file ArClientBase.h.

Referenced by logTracking(), resetTracking(), and trackPacketSent().

ArTime ArClientBase::myTrackingStarted [protected]
 

Definition at line 351 of file ArClientBase.h.

Referenced by logTracking(), and resetTracking().

bool ArClientBase::myUdpConfirmedFrom [protected]
 

Definition at line 300 of file ArClientBase.h.

Referenced by clear(), internalBlockingConnect(), and processPacketUdp().

bool ArClientBase::myUdpConfirmedTo [protected]
 

Definition at line 301 of file ArClientBase.h.

Referenced by clear(), internalBlockingConnect(), and processPacket().

unsigned int ArClientBase::myUdpPort [protected]
 

Definition at line 334 of file ArClientBase.h.

Referenced by internalConnect(), internalStartUdp(), and processPacket().

ArNetPacketReceiverUdp ArClientBase::myUdpReceiver [protected]
 

Definition at line 342 of file ArClientBase.h.

Referenced by ArClientBase(), and loopOnce().

struct sockaddr_in ArClientBase::myUdpSin [protected]
 

Definition at line 328 of file ArClientBase.h.

Referenced by internalStartUdp(), processPacket(), processPacketUdp(), and sendPacketUdp().

bool ArClientBase::myUdpSinValid [protected]
 

Definition at line 329 of file ArClientBase.h.

Referenced by internalStartUdp().

ArSocket ArClientBase::myUdpSocket [protected]
 

Definition at line 344 of file ArClientBase.h.

Referenced by ArClientBase(), finishNonBlockingDisconnect(), getUdpSocket(), internalBlockingConnect(), internalStartUdp(), logTracking(), loopOnce(), resetTracking(), and sendPacketUdp().

std::string ArClientBase::myUser [protected]
 

Definition at line 309 of file ArClientBase.h.

Referenced by internalBlockingConnect(), and processPacket().


The documentation for this class was generated from the following files:
Generated on Tue Feb 20 10:51:51 2007 for ArNetworking by  doxygen 1.4.0