/* ========================================================================== */ /* */ /* client.h */ /* (c) 2008 jocelyne.lecomte@alcatel-lucent.fr */ /* */ /* Description */ /* */ /* ========================================================================== */ #ifndef CLIENT_H #define CLIENT_H #include #include #include #include #include /* close */ #include /* gethostbyname */ /* socket error */ #define INVALID_SOCKET -1 #define SOCKET_ERROR -1 /* somes values */ #define CRLF "/r/n" #define BUF_SIZE 1024 /* to be more explicit */ typedef int SOCKET; typedef struct sockaddr_in SOCKADDR_IN; typedef struct sockaddr SOCKADDR; typedef struct in_addr IN_ADDR; static int init_connection(const char *address, const int port, SOCKADDR_IN *sin); static void end_connection(SOCKET sock); static int read_server(SOCKET sock, SOCKADDR_IN *sin, char *buffer); static void write_server(SOCKET sock, SOCKADDR_IN *sin, const char* buffer); void comm(const char *address, const int port); #endif