dtLMS::LmsClientSocket Class Reference

This class is designed to send and receive LMS messages over a TCP socket using a predetermined messaging protocol. More...

#include <lmsclientsocket.h>

List of all members.

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 LmsConnectionStateGetClientState ()
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.


Detailed Description

This class is designed to send and receive LMS messages over a TCP socket using a predetermined messaging protocol.

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.


Constructor & Destructor Documentation

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.

Parameters:
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.


Member Function Documentation

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  ) 


http://www.delta3d.org
2.0.0 generated 14 Feb 2008