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

SocketClient.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *  filename  : SocketClient.h
00003  *  authors   : Salvatore Monforte <salvatore.monforte@ct.infn.it>
00004  *  copyright : (C) 2001 by INFN
00005  ***************************************************************************/
00006 
00007 // $Id:
00008 
00018 #ifndef _SocketClient_h_
00019 #define _SocketClient_h_
00020 
00021 #include <sys/types.h>
00022 #include <sys/socket.h>
00023 #include <netinet/in.h>
00024 #include <netdb.h>
00025 
00026 #include <string>
00027 
00028 namespace edg {   
00029 namespace workload { 
00030 namespace common {
00031 namespace socket_pp {
00032 
00034 class SocketAgent;
00035 
00044 class SocketClient
00045 {
00046  public:
00047 
00053   SocketClient(const std::string&, int);
00058   virtual ~SocketClient();
00059   
00065   bool Send(const std::string&);
00066 
00072   bool Send(int);
00078   bool Send(long); 
00084   bool Receive(int&);
00090   bool Receive(long&);
00091  
00097   bool Receive(std::string&);
00098 
00103   virtual bool Open();
00108   virtual bool Close();
00109 
00115   bool SetTimeout(size_t secs);
00120   std::string Host() const { return host; }
00125   SocketAgent* getAgent() const;
00126 
00127  protected:
00134    bool AttachAgent(SocketAgent*);
00135 
00136  public:
00138   const std::string host;
00140   const int port;
00141 
00142  protected:
00144   SocketAgent *agent;
00145 };
00146 
00147 } // namespace socket_pp
00148 } // namespace common
00149 } // namespace workload
00150 } // namespace edg
00151 
00152 #endif
00153 
00154 /*
00155   Local Variables:
00156   mode: c++
00157   End:
00158 */
00159 

Generated on Fri May 14 14:18:26 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