#ifndef __CONNECTION_H__ #define __CONNECTION_H__ #include #ifndef _WIN32 # include # include # include # include # include # include #else # include # include # include #endif #ifndef _WIN32 typedef int SOCKET; #endif SOCKET connection_init(const char* server, const char* port); int connection_send(SOCKET sockfd, const char* buffer, int max_length); int connection_recv(SOCKET sockfd, char* buffer, int max_length); int connection_peek(SOCKET sockfd, char* buffer, int max_length); int connection_close(SOCKET sockfd); #endif // __CONNECTION_H__