H3DNetworkingUtils::RemoteUDPServer Class Reference

IMPORTANT NOTE: Do not route from anything in the haptics loop to a remote field if you have periodicSend FALSE. More...

#include <H3DNetworkingUtils/RemoteUDPServer.h>

Inheritance diagram for H3DNetworkingUtils::RemoteUDPServer:

Inheritance graph

List of all members.

Public Member Functions

 RemoteUDPServer ()
 Constructor.
virtual ~RemoteUDPServer ()
 Destructor.

Static Public Attributes

static H3D::H3DNodeDatabase database
 The X3D interface.

Protected Member Functions

virtual void sendThisPacket (Packet &packet)
 Write a single packet of data to socket.
virtual void receiveLoop ()
 This function runs in a new thread.
virtual void sendLoop ()
 This function runs in a new thread.
virtual void startServer (int port_number)
 Start the server.


Detailed Description

IMPORTANT NOTE: Do not route from anything in the haptics loop to a remote field if you have periodicSend FALSE.

The RemoteUDPServer class starts a Remote server using a UDP port.

This is because it will then try to send whenever the value changes - i.e. from the haptics loop itself. This will fail, because the haptics loop has special capabilities which seem to prevent it using sockets. 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:

It starts listening on the given port for a connection from a Remote Client, then continues with the base class's behaviour using the port for comms. UDP is connectionless, data can come from any client. In our usage, it should always come from the same client, although currently this is not checked. When open is changed from false to true, the listening port is monitored for a connection from a client. When it is changed from true to false, the connection is closed. At present, only one remote connection is handled at any one time.


Member Function Documentation

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

void RemoteUDPServer::startServer ( int  port_number  )  [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