RadarFX API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes
makRadarFx::DtRadarFxServer Class Reference

the DtRadarFxServer is the network server for receving and sending messages to attached clients. More...

Public Member Functions

 DtRadarFxServer (DtRadarFxDriver &driver, int port=4567, bool allowMultiple=false)
virtual ~DtRadarFxServer ()
virtual void initializeServer ()
 initialize and shutdown the TCP server
virtual void shutdownServer ()
virtual void setPort (int port)
 Set the port the server will listen on.
virtual int port () const
 Get the port the server has been configured to use.
virtual void sendMessage (DtBaseMessage &request)
 queue a message for sending a message to the client described in the message this function makes a copy of the message and the original message can go out of scope as soon as this function call ends.
virtual DtBaseMessagenextMessage ()
 Gets the next message from the connections, returns NULL if there are no more messages.

Static Public Member Functions

static double defaultHeartbeatTimeout ()
static void setDefaultHeatbeatTimeout (double val)

Protected Types

typedef std::map< std::string,
DtInetTcpSocket * > 
ClientRequestMap
typedef std::list
< DtInetTcpSocket * > 
ClientSocketList

Protected Member Functions

virtual bool handleSocketAddition (DtInetSocket *socket)
 Handle a sockets connecting and disconnecting.
virtual bool handleSocketRemoval (DtInetSocket *socket)

Static Protected Member Functions

static bool socketAdditionCallback (DtInetSocket *sock, void *usr)
 VR-Link callback when a connection is initiated.
static bool socketRemovalCallback (DtInetSocket *sock, void *usr)
static void workerFunction (void *usr, volatile bool *stop)
 Function that will be called when the network worker thread is started.

Protected Attributes

DtRadarFxDrivermyDriver
DtLocklessQueue< DtBaseMessage * > myOutgoingQueue
DtLocklessQueue< DtBaseMessage * > myIncomingQueue
DtInetSocketMgr * mySocketManager
int myPort
bool myAllowMultipleClients
DtThread * myWorkerThread
bool myShouldQuit
ClientRequestMap myClientRequestMap
ClientSocketList myClientSockets

Static Protected Attributes

static double theDefaultHeatbeatTimeout

Detailed Description

the DtRadarFxServer is the network server for receving and sending messages to attached clients.

Member Typedef Documentation

typedef std::map<std::string, DtInetTcpSocket*> makRadarFx::DtRadarFxServer::ClientRequestMap
protected
typedef std::list<DtInetTcpSocket*> makRadarFx::DtRadarFxServer::ClientSocketList
protected

Constructor & Destructor Documentation

makRadarFx::DtRadarFxServer::DtRadarFxServer ( DtRadarFxDriver driver,
int  port = 4567,
bool  allowMultiple = false 
)
virtual makRadarFx::DtRadarFxServer::~DtRadarFxServer ( )
virtual

Member Function Documentation

virtual void makRadarFx::DtRadarFxServer::initializeServer ( )
virtual

initialize and shutdown the TCP server

virtual void makRadarFx::DtRadarFxServer::shutdownServer ( )
virtual
virtual void makRadarFx::DtRadarFxServer::setPort ( int  port)
virtual

Set the port the server will listen on.

This will restart the server if the new port value is different than the existing one

virtual int makRadarFx::DtRadarFxServer::port ( ) const
virtual

Get the port the server has been configured to use.

virtual void makRadarFx::DtRadarFxServer::sendMessage ( DtBaseMessage request)
virtual

queue a message for sending a message to the client described in the message this function makes a copy of the message and the original message can go out of scope as soon as this function call ends.

virtual DtBaseMessage* makRadarFx::DtRadarFxServer::nextMessage ( )
virtual

Gets the next message from the connections, returns NULL if there are no more messages.

static double makRadarFx::DtRadarFxServer::defaultHeartbeatTimeout ( )
static
static void makRadarFx::DtRadarFxServer::setDefaultHeatbeatTimeout ( double  val)
static
virtual bool makRadarFx::DtRadarFxServer::handleSocketAddition ( DtInetSocket *  socket)
protectedvirtual

Handle a sockets connecting and disconnecting.

virtual bool makRadarFx::DtRadarFxServer::handleSocketRemoval ( DtInetSocket *  socket)
protectedvirtual
static bool makRadarFx::DtRadarFxServer::socketAdditionCallback ( DtInetSocket *  sock,
void *  usr 
)
staticprotected

VR-Link callback when a connection is initiated.

Calls handleSocketAddition() and handleSocketRemoval() respectively

static bool makRadarFx::DtRadarFxServer::socketRemovalCallback ( DtInetSocket *  sock,
void *  usr 
)
staticprotected
static void makRadarFx::DtRadarFxServer::workerFunction ( void *  usr,
volatile bool *  stop 
)
staticprotected

Function that will be called when the network worker thread is started.

Member Data Documentation

DtRadarFxDriver& makRadarFx::DtRadarFxServer::myDriver
protected
DtLocklessQueue<DtBaseMessage*> makRadarFx::DtRadarFxServer::myOutgoingQueue
protected
DtLocklessQueue<DtBaseMessage*> makRadarFx::DtRadarFxServer::myIncomingQueue
protected
DtInetSocketMgr* makRadarFx::DtRadarFxServer::mySocketManager
protected
int makRadarFx::DtRadarFxServer::myPort
protected
bool makRadarFx::DtRadarFxServer::myAllowMultipleClients
protected
DtThread* makRadarFx::DtRadarFxServer::myWorkerThread
protected
bool makRadarFx::DtRadarFxServer::myShouldQuit
protected
double makRadarFx::DtRadarFxServer::theDefaultHeatbeatTimeout
staticprotected
ClientRequestMap makRadarFx::DtRadarFxServer::myClientRequestMap
protected
ClientSocketList makRadarFx::DtRadarFxServer::myClientSockets
protected

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


Copyright © 2024 MAK Technologies, Inc. All Rights Reserved (www.mak.com)