#ifndef SERVEUR_H_INCLUDED #define SERVEUR_H_INCLUDED #ifdef WIN32 #include typedef int socklen_t; #elif defined (linux) #include #include #include #include #include #define INVALID_SOCKET -1 #define SOCKET_ERROR -1 #define closesocket(s) close (s) typedef int SOCKET; typedef struct sockaddr_in SOCKADDR_IN; typedef struct sockaddr SOCKADDR; #endif // WIN32 #include struct Sock { SOCKADDR_IN sin; SOCKET sock; socklen_t recsize; }; class Serveur { public: Serveur(int port, int nbrClient); ~Serveur(); bool rendreUtilisable(); void envoyer(void* donnee, int indice, int tailleByte); void recevoir(void* donnee, int indice, int tailleByte); private: #ifdef WIN32 WSADATA m_WSAData; #endif Sock m_sock; Sock *m_csock; int m_port; int m_erreur; const int m_nbrClient; }; #endif // SERVEUR_H_INCLUDED