#include <ArServerHandlerCommMonitor.h>
Public Types | |
enum | { MIN_HEARTBEAT_INTERVAL = 100, DEFAULT_HEARTBEAT_INTERVAL = 500 } |
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. | |
Static Public 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" |
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< ArServerHandlerCommMonitor > | myCycleCB |
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. | |
ArServerBase * | myServer |
Server from which requests are received. |
This class handles the following requests:
Definition at line 55 of file ArServerHandlerCommMonitor.h.
|
Definition at line 59 of file ArServerHandlerCommMonitor.h. |
|
Definition at line 41 of file ArServerHandlerCommMonitor.cpp. |
|
Destructor.
Definition at line 97 of file ArServerHandlerCommMonitor.cpp. |
|
Callback for the server cycle; broadcasts heartbeat packets when interval has elapsed.
Definition at line 147 of file ArServerHandlerCommMonitor.cpp. References ArServerBase::broadcastPacketTcp(), ArServerBase::broadcastPacketUdp(), HEARTBEAT_TCP_PACKET_NAME, HEARTBEAT_UDP_PACKET_NAME, ArTime::mSecSince(), myHeartbeatInterval, myLastHeartbeatTime, myServer, and ArTime::setToNow(). |
|
Definition at line 119 of file ArServerHandlerCommMonitor.cpp. References client, and ArClientBase::sendPacketTcp(). |
|
Definition at line 133 of file ArServerHandlerCommMonitor.cpp. References client, and ArClientBase::sendPacketUdp(). |
|
Definition at line 104 of file ArServerHandlerCommMonitor.cpp. References client, ArClientBase::sendPacketTcp(), and ArBasePacket::uByte4ToBuf(). |
|
Name of the network packet to confirm TCP communication.
Definition at line 34 of file ArServerHandlerCommMonitor.cpp. |
|
Name of the network packet to confirm UDP communication.
Definition at line 35 of file ArServerHandlerCommMonitor.cpp. |
|
Definition at line 36 of file ArServerHandlerCommMonitor.cpp. |
|
Name of the network packet to get the heartbeat interval.
Definition at line 33 of file ArServerHandlerCommMonitor.cpp. |
|
Name of the network packet broadcast (TCP) to confirm the server is alive.
Definition at line 30 of file ArServerHandlerCommMonitor.cpp. Referenced by cycleCallback(). |
|
Name of the network packet broadcast (UDP) to confirm the server is alive.
Definition at line 31 of file ArServerHandlerCommMonitor.cpp. Referenced by cycleCallback(). |
|
Callback for replying to the ack request (TCP).
Definition at line 142 of file ArServerHandlerCommMonitor.h. |
|
Callback for replying to the ack request (UDP).
Definition at line 139 of file ArServerHandlerCommMonitor.h. |
|
Cycle callback executed to broadcast the heartbeat packets.
Definition at line 144 of file ArServerHandlerCommMonitor.h. |
|
Callback for getting the heartbeat interval.
Definition at line 136 of file ArServerHandlerCommMonitor.h. |
|
Number of msecs between heartbeat broadcasts.
Definition at line 130 of file ArServerHandlerCommMonitor.h. Referenced by cycleCallback(). |
|
Time that the last heartbeat packets were broadcast.
Definition at line 132 of file ArServerHandlerCommMonitor.h. Referenced by cycleCallback(). |
|
Server from which requests are received.
Definition at line 127 of file ArServerHandlerCommMonitor.h. Referenced by cycleCallback(). |
|
Definition at line 37 of file ArServerHandlerCommMonitor.cpp. |