VR-Forces 4.0.4 Class Documentation
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]

List of all members.

Public Member Functions

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

Static Public Member Functions

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

Protected Member Functions

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

Protected Attributes

DtDemyDe
int mySocket
std::string myAddress
int myPort
bool myOkFlag
DtMessageStream myInputStream
DtMessageStream myOutputStream
DtDeRecord myRecord

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 
)

Construct a client from an existing socket.

DTOR.


Member Function Documentation

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

Deliver function.

Implements makVrv::DtMessageClient.

Send and flush the internal buffer.

This function is called by deliver.

Get any server messages.

Implements makVrv::DtMessageClient.

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

Connect.

Disconnect.

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.

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.

Read data from the server.

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.

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

void makVrv::DtTcpMessageClient::setSocket ( int  socket) [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]

Utility function.

bool makVrv::DtTcpMessageClient::sendString ( const std::string &  name) [protected]

Utility function.

bool makVrv::DtTcpMessageClient::sendInt ( int  value) [protected]

Utility function.

bool makVrv::DtTcpMessageClient::sendIGRecord ( const DtDeRecord record) [protected]

Send an IG's name.

Return values:
falseif it was unable to send the name.

Decode messages from data.


Member Data Documentation

std::string makVrv::DtTcpMessageClient::myAddress [protected]

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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)