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

SocketServer Class Reference

The connection Server. More...

Inheritance diagram for SocketServer:

GSISocketServer List of all members.

Public Member Functions

 SocketServer (int, int=5)
 Constructor.

virtual ~SocketServer ()
 Destructor.

bool Open ()
 Open the connection.

bool IsConnectionPending ()
 Return whether there is any pending connection.

virtual void Close ()
 Close the connection.

virtual SocketAgentListen (SocketAgent *=0)
 Listen for incoming connection requests.

void KillAgent (SocketAgent *)
 Kill a Socket Agent.


Protected Attributes

int sck
 The socket descriptor.


Detailed Description

The connection Server.

This object acts as Server in the message exchange. It listens for client connections and, when asked for, it receives, sets and sends back 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

SocketServer int  ,
int  = 5
 

Constructor.

Parameters:
p the server port.
b the backlog, that is the maximum number of outstanding connection requests.

virtual ~SocketServer  )  [virtual]
 

Destructor.

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


Member Function Documentation

virtual void Close  )  [virtual]
 

Close the connection.

Reimplemented in GSISocketServer.

bool IsConnectionPending  ) 
 

Return whether there is any pending connection.

Returns:
true if any pending connection exista, false otherwise.

void KillAgent SocketAgent  ) 
 

Kill a Socket Agent.

This also close the communication this agent holds.

Parameters:
a the agent to kill.

virtual SocketAgent* Listen SocketAgent = 0  )  [virtual]
 

Listen for incoming connection requests.

Accept incoming requests and redirect communication on a dedicated port.

Parameters:
a a reference to the Socket Agent sent by Client.
Returns:
the Socket Agent redirecting communication on a dediceted port.

bool Open  ) 
 

Open the connection.

Returns:
whether connection is established or not.


Member Data Documentation

int sck [protected]
 

The socket descriptor.


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