QApolloSocketClient Class Reference
[Networking]

Inheritance diagram for QApolloSocketClient:

QBaseClient QDaqClient QMsgClient QSlowControlClient

List of all members.


Detailed Description

generic socket client

Author:
Elena Guardincerri

Public Member Functions

 QApolloSocketClient ()
 default constructor
 QApolloSocketClient (const std::string &address, const std::string &port)
 constructor with address and port
virtual ~QApolloSocketClient ()
 destructor
bool Write (const std::string &Cmd)
 wrtite cmd to server
std::string Read () const
 read server response as a string
const std::string & GetServerPort () const
const std::string & GetServerAddress () const
void SetServerPort (const std::string &s)
void SetServerAddress (const std::string &s)
int Open ()
 open socket connection
bool Close ()
 close socket connection

Protected Attributes

int socketDescr

Private Member Functions

int ReadLine (char *data, int max_len) const
 read line as resoponse from server
bool Write (const char *buffer, int len)
 write buffer to socket

Private Attributes

std::string fServerAddress
std::string fServerPort

Member Function Documentation

int QApolloSocketClient::Open (  ) 

open socket connection

Returns:
file descriptor associated to opened socket

References Close(), fServerAddress, and fServerPort.

Referenced by QBaseClient::ExecCommand().

int QApolloSocketClient::ReadLine ( char *  data,
int  max_len 
) const [private]

read line as resoponse from server

Parameters:
data buffer filled with server response
max_len max buffer size
Returns:
number of unused bytes in buffer

Referenced by Read().

bool QApolloSocketClient::Write ( const char *  buffer,
int  len 
) [private]

write buffer to socket

Returns:
true on success, false on failure


Member Data Documentation

std::string QApolloSocketClient::fServerAddress [private]

server address

Referenced by Open().

std::string QApolloSocketClient::fServerPort [private]

server port

Referenced by Open().


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

Generated on Tue Nov 16 10:50:04 2010 for CUORE Software by  doxygen 1.5.6