ArServerHandlerCommMonitor Class Reference

#include <ArServerHandlerCommMonitor.h>

List of all members.


Detailed Description

Handler that enables the client to monitor communication to the robot server.

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 }

Public Member Functions

 ArServerHandlerCommMonitor (ArServerBase *server, int heartbeatInterval=DEFAULT_HEARTBEAT_INTERVAL)
 Constructs a new handler to monitor communication between the robot server and client.
void cycleCallback ()
 Callback for the server cycle; broadcasts heartbeat packets when interval has elapsed.
void handleAckCommTcp (ArServerClient *client, ArNetPacket *packet)
 Handles the ackCommTcp network packet.
void handleAckCommUdp (ArServerClient *client, ArNetPacket *packet)
 Handles the ackCommUdp network packet.
void handleGetHeartbeatInterval (ArServerClient *client, ArNetPacket *packet)
 Handles the getHeartbeatInterval network 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
 Name of the network packet to confirm TCP communication.
static const char * ACK_COMM_UDP_PACKET_NAME
 Name of the network packet to confirm UDP communication.
static const char * COMMAND_GROUP
static const char * GET_HEARTBEAT_INTERVAL_PACKET_NAME
 Name of the network packet to get the heartbeat interval.
static const char * HEARTBEAT_TCP_PACKET_NAME
 Name of the network packet broadcast (TCP) to confirm the server is alive.
static const char * HEARTBEAT_UDP_PACKET_NAME
 Name of the network packet broadcast (UDP) to confirm the server is alive.
static const char * NO_ARGS


Constructor & Destructor Documentation

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

Constructs a new handler to monitor communication between the robot server and client.

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


Member Function Documentation

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

Handles the ackCommTcp network packet.

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

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

Handles the ackCommUdp network packet.

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

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

Handles the getHeartbeatInterval network packet.

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


The documentation for this class was generated from the following file:
Generated on Thu Aug 6 09:40:12 2009 for ArNetworking by  doxygen 1.5.1