#include <lmsclientsocket.h>
Public Member Functions | |
| LmsClientSocket (const std::string &host, int port, bool reverseBytes) | |
| Constructor which handles the intialization of the socket. | |
| char | GetEndOfMessageChar () |
| void | SetEndOfMessageChar (char endOfMessageChar) |
| const LmsConnectionState * | GetClientState () |
| void | SetClientState (const LmsConnectionState *clientState) |
| const std::string & | GetClientID () const |
| void | Connect () |
| void | SendLmsMessage (const LmsMessage &lmsMessage) |
| LmsMessage | ReceiveLmsMessage () |
| void | Disconnect (bool normal=true) |
| virtual | ~LmsClientSocket () |
| Destructor. | |
It is a lightweight networking component that uses either Winsock32 (Windows) or the Berkeley sockets C API (Linux). Much of this code was derived from research done by Keith Vertanen on Java/C++ communication. See http://keithv.com/project/socket.html for more information.
| dtLMS::LmsClientSocket::LmsClientSocket | ( | const std::string & | host, | |
| int | port, | |||
| bool | reverseBytes | |||
| ) |
Constructor which handles the intialization of the socket.
If everything initializes ok then mClientState will be set to &LmsConnectionState::INITIALIZED. Otherwise, an LMS_CONNECTION_EXCEPTION will be thrown and mClientState will be set to &LmsConnectionState::ERRORSTATE.
| host | The name of machine hosting the LmsServerSocket (generally localhost) | |
| port | The port used for communication. | |
| reverseBytes | A flag to tell the LmsServerSocket if the byte order should be reversed (big/little endian issue). |
| dtLMS::LmsClientSocket::~LmsClientSocket | ( | ) | [virtual] |
Destructor.
| char dtLMS::LmsClientSocket::GetEndOfMessageChar | ( | ) | [inline] |
| void dtLMS::LmsClientSocket::SetEndOfMessageChar | ( | char | endOfMessageChar | ) | [inline] |
| const LmsConnectionState* dtLMS::LmsClientSocket::GetClientState | ( | ) | [inline] |
| void dtLMS::LmsClientSocket::SetClientState | ( | const LmsConnectionState * | clientState | ) | [inline] |
| const std::string& dtLMS::LmsClientSocket::GetClientID | ( | ) | const [inline] |
| void dtLMS::LmsClientSocket::Connect | ( | ) |
| void dtLMS::LmsClientSocket::SendLmsMessage | ( | const LmsMessage & | lmsMessage | ) |
| LmsMessage dtLMS::LmsClientSocket::ReceiveLmsMessage | ( | ) |
| void dtLMS::LmsClientSocket::Disconnect | ( | bool | normal = true |
) |