H3DNetworkingUtils::RemoteUDPClient Class Reference

The RemoteUDPClient class starts a Remote client using a UDP port. More...

#include <H3DNetworkingUtils/RemoteUDPClient.h>

Inheritance diagram for H3DNetworkingUtils::RemoteUDPClient:

Inheritance graph

List of all members.

Public Member Functions

 RemoteUDPClient ()
 Constructor.
virtual ~RemoteUDPClient ()
 Destructor.

Static Public Attributes

static const H3D::H3DFloat PULSE_PERIOD = 1.0
 The period between heartbeats for a UDP socket.
static H3D::H3DNodeDatabase database
 X3D interface.

Protected Member Functions

virtual void sendThisPacket (Packet &packet)
 Send a single packet.
virtual void restartClient ()
 Restarts the client reading and writing to a new socket.
virtual void receiveLoop ()
 Wait and receive packets.
virtual void sendLoop ()
 Send packets. Also send a 'pulse' packet, if no send has happened for a PULSE_PERIOD.
virtual void requestClose ()
 Request for the connection to close.


Detailed Description

The RemoteUDPClient class starts a Remote client using a UDP port.

It connects to a given server and port. It has a send loop, receive loop and a 'pulse' loop which tells the server it is still alive. Each loop runs in a different thread. At present, only one remote connection is handled at a time. IMPORTANT NOTE: Do not route from anything in the haptics loop to a remote field if you have periodicSend FALSE. This is because it will then try to send whenever the value changes - i.e. from the haptics loop itself. This will fail. You probably don't want it to interrupt haptics to do socket stuff anyway. Make sure you set periodic send true if you are routing in from the haptics thread. When the client first connects, it sends a pulse packet to the server. The servers responds with a pulse.
Examples:


Member Function Documentation

void RemoteUDPClient::receiveLoop (  )  [protected, virtual]


The documentation for this class was generated from the following files:

Generated on Fri Mar 12 10:23:10 2010 for H3DNetworkingUtils by  doxygen 1.5.6