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

edg::workload::common::socket_pp::SocketClient Class Reference

The connection Client. More...

Inheritance diagram for edg::workload::common::socket_pp::SocketClient:

edg::workload::common::socket_pp::GSISocketClient List of all members.

Public Methods

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

virtual ~SocketClient ()
 Destructor. More...

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

bool Send (int)
 Send an int value. More...

bool Send (long)
 Send a long value. More...

bool Receive (int &)
 Receive an int value. More...

bool Receive (long &)
 Receive a long value. More...

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

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

virtual bool Close ()
 Close the connection. More...

bool SetTimeout (size_t secs)
 Set the connection timeout. More...

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

SocketAgentgetAgent () const
 Returns a pointer to the SocketAgent. More...


Public Attributes

const std::string host
 The host name.

const int port
 The host port.


Protected Methods

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


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 edg::workload::common::socket_pp::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 edg::workload::common::socket_pp::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.


The documentation for this class was generated from the following file:
Generated on Fri May 14 14:18:27 2004 for COMMON API - configuration, jobid, ldif2classadi, logger, process, requestad, socket++i, task, utilities by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002