VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes
makVrv::DtTcpServer Class Reference

This is used by the master to connect to slaves.

Public Types

typedef std::list
< DtTcpMessageClient * > 
ClientList
 

Public Member Functions

 DtTcpServer (DtDe &de, int port)
 
 ~DtTcpServer ()
 
bool isListening () const
 
void startListening ()
 
void stopListening ()
 
int numberOfConnections ()
 
void cleanupDisconnectedClients ()
 
void checkForMessages ()
 
void addClient (DtTcpMessageClient *)
 
const ClientListclients () const
 
void deleteClient (DtTcpMessageClient *client, bool lostConnection=false)
 
DtTcpMessageClientfindClient (const std::string &name)
 
void deleteClients ()
 

Static Public Member Functions

static void setBlocking (int fd, bool blocking)
 

Static Public Attributes

static const std::string theServerHandshake
 
static const std::string theClientHandshake
 

Protected Member Functions

void handleNewConnections ()
 
void buildSocketList ()
 
void processReads ()
 

Protected Attributes

DtDemyDe
 
int mySocket
 
int myHighSocket
 
int myPort
 
fd_set * myReceiveSet
 
ClientList myClients
 
DtMessageDispatchermyDispatcher
 

Member Typedef Documentation

Constructor & Destructor Documentation

makVrv::DtTcpServer::DtTcpServer ( DtDe de,
int  port 
)

CTOR.

makVrv::DtTcpServer::~DtTcpServer ( )

DTOR.

Member Function Documentation

bool makVrv::DtTcpServer::isListening ( ) const

Get whether the server is listening for connections.

void makVrv::DtTcpServer::startListening ( )

Start listening.

void makVrv::DtTcpServer::stopListening ( )

Stop listening.

int makVrv::DtTcpServer::numberOfConnections ( )

Get the number of connections.

void makVrv::DtTcpServer::cleanupDisconnectedClients ( )

Check for disconnected clients and delete them if they are disconnected.

void makVrv::DtTcpServer::checkForMessages ( )

Check existing clients for new messages.

void makVrv::DtTcpServer::addClient ( DtTcpMessageClient )

Manually Add a client. The client should already be connected.

Warning
Be careful not to add the same client multiple times.
Exceptions
DtInvalidInputif the pointer is null.
const ClientList& makVrv::DtTcpServer::clients ( ) const

Get the clients.

void makVrv::DtTcpServer::deleteClient ( DtTcpMessageClient client,
bool  lostConnection = false 
)

Manually Remove a client;.

DtTcpMessageClient* makVrv::DtTcpServer::findClient ( const std::string &  name)

Attempt to find a client based upon it's name.

void makVrv::DtTcpServer::deleteClients ( )

Delete all clients.

static void makVrv::DtTcpServer::setBlocking ( int  fd,
bool  blocking 
)
static

Modify the blocking state of a socket.

void makVrv::DtTcpServer::handleNewConnections ( )
protected

Check for new connections.

void makVrv::DtTcpServer::buildSocketList ( )
protected

Add a socket to listen for data.

void makVrv::DtTcpServer::processReads ( )
protected

Process reads.

Member Data Documentation

const std::string makVrv::DtTcpServer::theServerHandshake
static
const std::string makVrv::DtTcpServer::theClientHandshake
static
DtDe& makVrv::DtTcpServer::myDe
protected
int makVrv::DtTcpServer::mySocket
protected
int makVrv::DtTcpServer::myHighSocket
protected
int makVrv::DtTcpServer::myPort
protected
fd_set* makVrv::DtTcpServer::myReceiveSet
protected
ClientList makVrv::DtTcpServer::myClients
protected
DtMessageDispatcher& makVrv::DtTcpServer::myDispatcher
protected

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

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)