![]() |
VR-Forces Development_Version Class Documentation
|
A remote TCP client that the TCP server communicates with. More...

Public Member Functions | |
| DtTcpMessageClient (DtDe &de, int socket, const std::string &localAddress, int port, bool useBlockingSend=false) | |
| 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 DtDeRecord & | connectionRecord () |
| Get a de record for this client that was sent during connection. | |
| double | sendTimeout () const |
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 | |
| DtDe & | myDe |
| int | mySocket |
| std::string | myAddress |
| int | myPort |
| bool | myOkFlag |
| double | mySendTimeout |
| DtMessageStream | myInputStream |
| DtMessageStream | myOutputStream |
| DtDeRecord | myRecord |
| bool | myUseBlockingSend |
Additional Inherited Members |
A remote TCP client that the TCP server communicates with.
| makVrv::DtTcpMessageClient::DtTcpMessageClient | ( | DtDe & | de, |
| int | socket, | ||
| const std::string & | localAddress, | ||
| int | port, | ||
| bool | useBlockingSend = false |
||
| ) |
Construct a client from an existing socket.
| makVrv::DtTcpMessageClient::~DtTcpMessageClient | ( | ) |
DTOR.
|
virtual |
Deliver function.
Implements makVrv::DtMessageClient.
| void makVrv::DtTcpMessageClient::sendAndFlush | ( | ) |
Send and flush the internal buffer.
This function is called by deliver.
|
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 |
Validate the client connection.
| true | if connection was validated. |
| false | if unable to validate connection. |
|
virtual |
Check to see if I am connected.
| int makVrv::DtTcpMessageClient::socket | ( | ) | const |
Get the remote client socket.
|
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 |
Fill nameOut with the hostname, process id string.
|
virtual |
The name will be the receiver name rather than the local name.
Reimplemented from makVrv::DtMessageClient.
|
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 |
|
protected |
|
protected |
Receive an IG's name and store it in the provided string.
| false | if it was unable to receive the name. |
|
protected |
Utility function.
|
protected |
Utility function.
|
protected |
Utility function.
|
protected |
Utility function.
|
protected |
Send an IG's name.
| false | if it was unable to send the name. |
|
protected |
|
protected |
Decode messages from data.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |