Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

SocketClient Class Reference

The connection Client. More...

Inheritance diagram for SocketClient:

GSISocketClient List of all members.

Public Member Functions

 SocketClient (const std::string &, int)
 Constructor.

virtual ~SocketClient ()
 Destructor.

bool Send (const std::string &)
 Send a string value.

bool Send (int)
 Send an int value.

bool Send (long)
 Send a long value.

bool Receive (int &)
 Receive an int value.

bool Receive (long &)
 Receive a long value.

bool Receive (std::string &)
 Receive a string value.

virtual bool Open ()
 Open a connection to the Server.

virtual bool Close ()
 Close the connection.

bool SetTimeout (size_t secs)
 Set the connection timeout.

std::string Host () const
 Return the host name.

SocketAgentgetAgent () const
 Returns a pointer to the SocketAgent.


Public Attributes

const std::string host
 The host name.

const int port
 The host port.


Protected Member Functions

bool AttachAgent (SocketAgent *)
 Attach an agent to this client.


Protected Attributes

SocketAgentagent
 The Socket Agent reference for message exchange.


Detailed Description

The connection Client.

This object acts as Client in the message exchange. It requests the server for connections and it creates and sends the reference to the agent to be used for message exchange.

Author:
Salvatore Monforte salvatore.monforte@ct.infn.it

comments by Marco Pappalardo marco.pappalardo@ct.infn.it and Salvatore Monforte


Constructor & Destructor Documentation

SocketClient const std::string &  ,
int 
 

Constructor.

Parameters:
h the host name.
p the host port.

virtual ~SocketClient  )  [virtual]
 

Destructor.

This method must be also implemented by object subclassing server socket.


Member Function Documentation

bool AttachAgent SocketAgent  )  [protected]
 

Attach an agent to this client.

This method also connects the agent to the proper server.

Parameters:
a the Socket Agent to attach.
Returns:
true for a successful attachment, false otherwise.

virtual bool Close  )  [virtual]
 

Close the connection.

Returns:
true on success, false otherwise.

Reimplemented in GSISocketClient.

SocketAgent* getAgent  )  const
 

Returns a pointer to the SocketAgent.

Returns:
a reference to the related Socket Agent.

std::string Host  )  const [inline]
 

Return the host name.

Returns:
the host name string.

virtual bool Open  )  [virtual]
 

Open a connection to the Server.

Returns:
true on success, false otherwise.

Reimplemented in GSISocketClient.

bool Receive std::string &   ) 
 

Receive a string value.

Parameters:
s the string to fill.
Returns:
true on success, false otherwise.

bool Receive long &   ) 
 

Receive a long value.

Parameters:
i a long to fill.
Returns:
true on success, false otherwise.

bool Receive int &   ) 
 

Receive an int value.

Parameters:
i an int to fill.
Returns:
true on success, false otherwise.

bool Send long   ) 
 

Send a long value.

Parameters:
i the long value to send.
Returns:
true on success, false otherwise.

bool Send int   ) 
 

Send an int value.

Parameters:
i the int value to send.
Returns:
true on success, false otherwise.

bool Send const std::string &   ) 
 

Send a string value.

Parameters:
s the string value to send.
Returns:
true on success, false otherwise.

bool SetTimeout size_t  secs  ) 
 

Set the connection timeout.

Parameters:
secs a size_t representing the timeout in seconds.
Returns:
tru on success, false otherwise.


Member Data Documentation

SocketAgent* agent [protected]
 

The Socket Agent reference for message exchange.

const std::string host
 

The host name.

const int port
 

The host port.


The documentation for this class was generated from the following file:
Generated on Wed Mar 1 00:37:57 2006 for COMMON API - configuration, jobid, ldif2classadi, logger, process, requestad, socket++i, task, utilities by doxygen 1.3.5