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

SocketAgent.h

Go to the documentation of this file.
00001 /*
00002  * SocketAgent.h
00003  * 
00004  * Copyright (C) 2002 EU-Datagrid.
00005  * For license conditions see http://www.eu-datagrid.org/license.html
00006  */
00007 
00008 #ifndef __SOCKETAGENT__
00009 #define __SOCKETAGENT__
00010 
00011 #include <sys/socket.h>
00012 #include <netinet/in.h>
00013 #include <netdb.h>
00014 
00015 #include <string>
00016 
00017 namespace edg {
00018 namespace workload {
00019 namespace common { 
00020 namespace socket_pp {
00021 
00029 class SocketAgent
00030 { 
00031  public:  
00032 
00038   virtual bool Send(const std::string&);
00044   virtual bool Send(int);
00050   virtual bool Send(long);
00051   
00057   virtual bool Receive(int&);
00063   virtual bool Receive(long&);
00069   virtual bool Receive(std::string&);
00070   
00075   std::string HostName();
00081   bool SetTimeout(size_t);
00087   bool SetRcvTimeout(size_t);
00093   bool SetSndTimeout(size_t);
00098   int SocketDescriptor() { return sck; }
00099 
00100 
00101 protected:
00102 
00106   SocketAgent();
00110   virtual ~SocketAgent();
00111   
00112  private:
00119   bool sendbuffer(char *, unsigned int);
00126   bool readbuffer(char *, unsigned int);
00127 
00129   friend class SocketServer;
00131   friend class SocketClient;
00132     
00133   struct sockaddr_in peeraddr_in;       
00135 protected:
00137   int sck;
00138 };
00139 
00140 } // namespace socket_pp
00141 } // namespace common
00142 } // namespace workload
00143 } // namespace edg
00144 
00145 
00146 #endif
00147 
00148 /*
00149   Local Variables:
00150   mode: c++
00151   End:
00152 */
00153 
00154 
00155 

Generated on Wed Mar 1 00:37:55 2006 for COMMON API - configuration, jobid, ldif2classadi, logger, process, requestad, socket++i, task, utilities by doxygen 1.3.5