| 1 | #ifndef __SERVER_H__ |
| 2 | #define __SERVER_H__ |
| 3 | |
| 4 | #ifdef _WIN32 /* Windows */ |
| 5 | #include <ws2tcpip.h> |
| 6 | typedef SOCKET socket_t; |
| 7 | #else /* Posix */ |
| 8 | typedef int socket_t; |
| 9 | #endif |
| 10 | |
| 11 | void init_network_context (void); |
| 12 | void terminate_network_context (void); |
| 13 | |
| 14 | int open_listening_socket (int port); |
| 15 | int accept_incoming_connection (void); |
| 16 | |
| 17 | void close_connection (void); |
| 18 | |
| 19 | int receive_data (char **pdata); |
| 20 | int send_data (char *data, int len); |
| 21 | |
| 22 | #endif /* __SERVER_H__ */ |
| 23 | |
| 24 | /* vim: set ts=4 sw=4 et: */ |