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

SocketAgent.h

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);
00094 protected:
00095 
00099   SocketAgent();
00103   virtual ~SocketAgent();
00104   
00105  private:
00112   bool sendbuffer(char *, unsigned int);
00119   bool readbuffer(char *, unsigned int);
00120 
00122   friend class SocketServer;
00124   friend class SocketClient;
00125     
00126   struct sockaddr_in peeraddr_in;       
00128 protected:
00130   int sck;
00131 };
00132 
00133 } // namespace socket_pp
00134 } // namespace common
00135 } // namespace workload
00136 } // namespace edg
00137 
00138 
00139 #endif
00140 
00141 /*
00142   Local Variables:
00143   mode: c++
00144   End:
00145 */
00146 
00147 
00148 

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