Page principale | Liste des namespaces | Hiérarchie des classes | Liste alphabétique | Liste des classes | Liste des fichiers | Membres de namespace | Membres de classe

protocol.hpp

00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00039 #ifndef __PROTOCOL_HPP__
00040 #define __PROTOCOL_HPP__
00041 
00042 #define SIZE_MAXI 200000    // La taille max d'une image (en octet)
00043 
00044 #include <string>
00045 
00046 
00047 #if defined(WIN32)
00048   #include <winsock2.h>   // Pour les fonctions socket Windows
00049 #else
00050   #include <sys/types.h>
00051   #include <netinet/in.h>
00052   #include <sys/socket.h>
00053   #include <arpa/inet.h>
00054   typedef int SOCKET;    // Pour une compatibilite Windows/Linux
00055   typedef struct sockaddr_in SOCKADDR_IN; // Pour une compatibilite Windows/Linux
00056 #endif
00057 
00058 
00062 typedef struct
00063 {
00065   SOCKET id;
00066   
00068   SOCKADDR_IN server;
00069 } Sock;
00070 
00081 struct Protocol
00082 {
00086   Sock info;
00087 
00091   SOCKET id_client;
00092   
00096   virtual ~Protocol() {};
00097   
00104   virtual bool connection ( std::string address, unsigned int port ) = 0;
00105   
00106   
00111   virtual bool deconnection (  ) = 0;
00112   
00118   virtual void send ( const char* data, size_t sz ) = 0;
00119   
00128   virtual void receive( size_t s, unsigned char* buf, size_t* buf_sz) = 0;
00129   
00133   virtual void getInfo (  ) = 0;
00134 };
00135 
00136 #endif

Généré le Wed Aug 16 12:33:36 2006 pour IpsiC++library par  doxygen 1.4.4