ArServerHandlerCommMonitor Class Reference

#include <ArServerHandlerCommMonitor.h>

List of all members.


Detailed Description

ArServerHandlerCommMonitor defines network packet handlers that simply verify the communication between the robot and server.

This class handles the following requests:


Public Types

enum  { MIN_HEARTBEAT_INTERVAL = 100, DEFAULT_HEARTBEAT_INTERVAL = 500 }
 DEFAULT_HEARTBEAT_INTERVAL = 500
 MIN_HEARTBEAT_INTERVAL = 100

Public Member Functions

 ArServerHandlerCommMonitor (ArServerBase *server, int heartbeatInterval=DEFAULT_HEARTBEAT_INTERVAL)
void cycleCallback ()
 Callback for the server cycle; broadcasts heartbeat packets when interval has elapsed.
void handleAckCommTcp (ArServerClient *client, ArNetPacket *packet)
void handleAckCommUdp (ArServerClient *client, ArNetPacket *packet)
void handleGetHeartbeatInterval (ArServerClient *client, ArNetPacket *packet)
virtual ~ArServerHandlerCommMonitor ()
 Destructor.

Protected Attributes

ArFunctor2C< ArServerHandlerCommMonitor,
ArServerClient *, ArNetPacket * > 
myAckCommTcpCB
 Callback for replying to the ack request (TCP).
ArFunctor2C< ArServerHandlerCommMonitor,
ArServerClient *, ArNetPacket * > 
myAckCommUdpCB
 Callback for replying to the ack request (UDP).
ArFunctorC< ArServerHandlerCommMonitormyCycleCB
 Cycle callback executed to broadcast the heartbeat packets.
ArFunctor2C< ArServerHandlerCommMonitor,
ArServerClient *, ArNetPacket * > 
myGetHeartbeatIntervalCB
 Callback for getting the heartbeat interval.
int myHeartbeatInterval
 Number of msecs between heartbeat broadcasts.
ArTime myLastHeartbeatTime
 Time that the last heartbeat packets were broadcast.
ArServerBasemyServer
 Server from which requests are received.

Static Protected Attributes

static const char * ACK_COMM_TCP_PACKET_NAME = "ackCommTcp"
 Name of the network packet to confirm TCP communication.
static const char * ACK_COMM_UDP_PACKET_NAME = "ackCommUdp"
 Name of the network packet to confirm UDP communication.
static const char * COMMAND_GROUP = "RobotInfo"
static const char * GET_HEARTBEAT_INTERVAL_PACKET_NAME = "getHeartbeatInterval"
 Name of the network packet to get the heartbeat interval.
static const char * HEARTBEAT_TCP_PACKET_NAME = "heartbeatTcp"
 Name of the network packet broadcast (TCP) to confirm the server is alive.
static const char * HEARTBEAT_UDP_PACKET_NAME = "heartbeatUdp"
 Name of the network packet broadcast (UDP) to confirm the server is alive.
static const char * NO_ARGS = "None"


Member Enumeration Documentation

anonymous enum

Enumerator:
MIN_HEARTBEAT_INTERVAL 
DEFAULT_HEARTBEAT_INTERVAL 


Constructor & Destructor Documentation

ArServerHandlerCommMonitor::ArServerHandlerCommMonitor ( ArServerBase server,
int  heartbeatInterval = DEFAULT_HEARTBEAT_INTERVAL 
)

Parameters:
server the ArServerBase used to send/receive requests
heartBeatInterval How often to send a "heartbeat" packet to the client

ArServerHandlerCommMonitor::~ArServerHandlerCommMonitor (  )  [virtual]

Destructor.


Member Function Documentation

void ArServerHandlerCommMonitor::cycleCallback (  ) 

Callback for the server cycle; broadcasts heartbeat packets when interval has elapsed.

void ArServerHandlerCommMonitor::handleAckCommTcp ( ArServerClient client,
ArNetPacket packet 
)

Parameters:
client the ArServerClient * that sent the request
packet the ArNetPacket * that contains the request

void ArServerHandlerCommMonitor::handleAckCommUdp ( ArServerClient client,
ArNetPacket packet 
)

Parameters:
client the ArServerClient * that sent the request
packet the ArNetPacket * that contains the request

void ArServerHandlerCommMonitor::handleGetHeartbeatInterval ( ArServerClient client,
ArNetPacket packet 
)

Parameters:
client the ArServerClient * that sent the request
packet the ArNetPacket * that contains the request


Member Data Documentation

const char * ArServerHandlerCommMonitor::ACK_COMM_TCP_PACKET_NAME = "ackCommTcp" [static, protected]

Name of the network packet to confirm TCP communication.

const char * ArServerHandlerCommMonitor::ACK_COMM_UDP_PACKET_NAME = "ackCommUdp" [static, protected]

Name of the network packet to confirm UDP communication.

const char * ArServerHandlerCommMonitor::COMMAND_GROUP = "RobotInfo" [static, protected]

const char * ArServerHandlerCommMonitor::GET_HEARTBEAT_INTERVAL_PACKET_NAME = "getHeartbeatInterval" [static, protected]

Name of the network packet to get the heartbeat interval.

const char * ArServerHandlerCommMonitor::HEARTBEAT_TCP_PACKET_NAME = "heartbeatTcp" [static, protected]

Name of the network packet broadcast (TCP) to confirm the server is alive.

const char * ArServerHandlerCommMonitor::HEARTBEAT_UDP_PACKET_NAME = "heartbeatUdp" [static, protected]

Name of the network packet broadcast (UDP) to confirm the server is alive.

ArFunctor2C<ArServerHandlerCommMonitor, ArServerClient *, ArNetPacket *> ArServerHandlerCommMonitor::myAckCommTcpCB [protected]

Callback for replying to the ack request (TCP).

ArFunctor2C<ArServerHandlerCommMonitor, ArServerClient *, ArNetPacket *> ArServerHandlerCommMonitor::myAckCommUdpCB [protected]

Callback for replying to the ack request (UDP).

ArFunctorC<ArServerHandlerCommMonitor> ArServerHandlerCommMonitor::myCycleCB [protected]

Cycle callback executed to broadcast the heartbeat packets.

ArFunctor2C<ArServerHandlerCommMonitor, ArServerClient *, ArNetPacket *> ArServerHandlerCommMonitor::myGetHeartbeatIntervalCB [protected]

Callback for getting the heartbeat interval.

int ArServerHandlerCommMonitor::myHeartbeatInterval [protected]

Number of msecs between heartbeat broadcasts.

ArTime ArServerHandlerCommMonitor::myLastHeartbeatTime [protected]

Time that the last heartbeat packets were broadcast.

ArServerBase* ArServerHandlerCommMonitor::myServer [protected]

Server from which requests are received.

const char * ArServerHandlerCommMonitor::NO_ARGS = "None" [static, protected]


The documentation for this class was generated from the following files:
Generated on Fri Jul 31 12:37:29 2009 for ArNetworking by  doxygen 1.4.7