VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
makVrv::DtTcpMessageClient Class Reference

A remote TCP client that the TCP server communicates with. More...

Inheritance diagram for makVrv::DtTcpMessageClient:
Inheritance graph
[legend]

Public Member Functions

 DtTcpMessageClient (DtDe &de, int socket, const std::string &localAddress, int port, bool useBlockingSend=false)
 Construct a client from an existing socket. More...
 
virtual ~DtTcpMessageClient ()
 DTOR. More...
 
virtual void deliver (DtMessage &msg)
 Deliver function. More...
 
void sendAndFlush ()
 Send and flush the internal buffer. More...
 
virtual void getServerMessages (MessageList &)
 Get any server messages. More...
 
void connectToListener (const std::string &address, int port)
 Connect. More...
 
void disconnect ()
 Disconnect. More...
 
virtual bool validateConnection ()
 Validate the client connection. More...
 
virtual bool isConnected () const
 Check to see if I am connected. More...
 
int socket () const
 Get the remote client socket. More...
 
virtual int port () const
 Get the current port. More...
 
const std::string & address () const
 Get the client's address. More...
 
void readData ()
 Read data from the server. More...
 
bool isOk () const
 Check to see if the client is ok. More...
 
virtual const std::string & name () const
 The name will be the receiver name rather than the local name. More...
 
const DtDeRecordconnectionRecord ()
 Get a de record for this client that was sent during connection. More...
 
double sendTimeout () const
 
- Public Member Functions inherited from makVrv::DtMessageClient
 DtMessageClient (const std::string &clientName)
 static const int ClientNameSize = 128; More...
 
virtual ~DtMessageClient ()
 DTOR. More...
 

Static Public Member Functions

static void getUniqueClientName (std::string &nameOut)
 Fill nameOut with the hostname, process id string. More...
 
static std::string errorString (int code)
 Get a string description of the error code. More...
 

Protected Member Functions

void setSocket (int socket)
 
bool receiveIgRecord (DtDeRecord &name)
 Receive an IG's name and store it in the provided string. More...
 
bool sendIGRecord (const DtDeRecord &record)
 Send an IG's name. More...
 
int lastError ()
 
void getMessagesFromData ()
 Decode messages from data. More...
 
bool receiveString (std::string &string)
 Utility function. More...
 
bool receiveInt (int &value)
 
bool sendString (const std::string &name)
 
bool sendInt (int value)
 

Protected Attributes

DtDemyDe
 
int mySocket
 
std::string myAddress
 
int myPort
 
bool myOkFlag
 
double mySendTimeout
 
DtMessageStream myInputStream
 
DtMessageStream myOutputStream
 
DtDeRecord myRecord
 
bool myUseBlockingSend
 
- Protected Attributes inherited from makVrv::DtMessageClient
std::vector< IGIInterfaceIDmyInterfaceMap
 
std::string myName
 

Additional Inherited Members

- Public Types inherited from makVrv::DtMessageClient
typedef std::vector< DtMessage * > MessageList
 
typedef unsigned short IGIInterfaceID
 The IGIInterfaceID type. More...
 

Detailed Description

A remote TCP client that the TCP server communicates with.

Constructor & Destructor Documentation

makVrv::DtTcpMessageClient::DtTcpMessageClient ( DtDe de,
int  socket,
const std::string &  localAddress,
int  port,
bool  useBlockingSend = false 
)

Construct a client from an existing socket.

virtual makVrv::DtTcpMessageClient::~DtTcpMessageClient ( )
virtual

DTOR.

Member Function Documentation

virtual void makVrv::DtTcpMessageClient::deliver ( DtMessage msg)
virtual

Deliver function.

Implements makVrv::DtMessageClient.

void makVrv::DtTcpMessageClient::sendAndFlush ( )

Send and flush the internal buffer.

This function is called by deliver.

virtual void makVrv::DtTcpMessageClient::getServerMessages ( MessageList )
virtual

Get any server messages.

Implements makVrv::DtMessageClient.

void makVrv::DtTcpMessageClient::connectToListener ( const std::string &  address,
int  port 
)

Connect.

void makVrv::DtTcpMessageClient::disconnect ( )

Disconnect.

virtual bool makVrv::DtTcpMessageClient::validateConnection ( )
virtual

Validate the client connection.

Return values
trueif connection was validated.
falseif unable to validate connection.
virtual bool makVrv::DtTcpMessageClient::isConnected ( ) const
virtual

Check to see if I am connected.

int makVrv::DtTcpMessageClient::socket ( ) const

Get the remote client socket.

virtual int makVrv::DtTcpMessageClient::port ( ) const
virtual

Get the current port.

const std::string& makVrv::DtTcpMessageClient::address ( ) const

Get the client's address.

void makVrv::DtTcpMessageClient::readData ( )

Read data from the server.

bool makVrv::DtTcpMessageClient::isOk ( ) const

Check to see if the client is ok.

static void makVrv::DtTcpMessageClient::getUniqueClientName ( std::string &  nameOut)
static

Fill nameOut with the hostname, process id string.

virtual const std::string& makVrv::DtTcpMessageClient::name ( ) const
virtual

The name will be the receiver name rather than the local name.

Reimplemented from makVrv::DtMessageClient.

static std::string makVrv::DtTcpMessageClient::errorString ( int  code)
static

Get a string description of the error code.

const DtDeRecord& makVrv::DtTcpMessageClient::connectionRecord ( )

Get a de record for this client that was sent during connection.

double makVrv::DtTcpMessageClient::sendTimeout ( ) const
void makVrv::DtTcpMessageClient::setSocket ( int  socket)
protected
bool makVrv::DtTcpMessageClient::receiveIgRecord ( DtDeRecord name)
protected

Receive an IG's name and store it in the provided string.

Return values
falseif it was unable to receive the name.
bool makVrv::DtTcpMessageClient::receiveString ( std::string &  string)
protected

Utility function.

bool makVrv::DtTcpMessageClient::receiveInt ( int value)
protected
bool makVrv::DtTcpMessageClient::sendString ( const std::string &  name)
protected
bool makVrv::DtTcpMessageClient::sendInt ( int  value)
protected
bool makVrv::DtTcpMessageClient::sendIGRecord ( const DtDeRecord record)
protected

Send an IG's name.

Return values
falseif it was unable to send the name.
int makVrv::DtTcpMessageClient::lastError ( )
protected
void makVrv::DtTcpMessageClient::getMessagesFromData ( )
protected

Decode messages from data.

Member Data Documentation

DtDe& makVrv::DtTcpMessageClient::myDe
protected
int makVrv::DtTcpMessageClient::mySocket
protected
std::string makVrv::DtTcpMessageClient::myAddress
protected
int makVrv::DtTcpMessageClient::myPort
protected
bool makVrv::DtTcpMessageClient::myOkFlag
protected
double makVrv::DtTcpMessageClient::mySendTimeout
protected
DtMessageStream makVrv::DtTcpMessageClient::myInputStream
protected
DtMessageStream makVrv::DtTcpMessageClient::myOutputStream
protected
DtDeRecord makVrv::DtTcpMessageClient::myRecord
protected
bool makVrv::DtTcpMessageClient::myUseBlockingSend
protected

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

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)