#ifndef CLIENT_H_INCLUDED #define CLIENT_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 Client { public: Client(std::string IP, int port); ~Client(); bool rendreUtilisable(); void envoyer(void* donnee, int tailleByte); void recevoir(void* donnee, int tailleByte); private: #ifdef WIN32 WSADATA m_WSAData; #endif Sock m_csock; std::string m_IP; int m_port; int m_erreur; }; #endif // CLIENT_H_INCLUDED