1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#ifndef NET__SERVER_H #define NET__SERVER_H #include "./common.h" typedef struct { int listen_socket_fd; } server_t; server_t* server_init_tcp(const char* addr, const char* port); void server_shutdown(server_t* srv); conn_t* conn_try_accept(server_t* srv); void conn_close(conn_t* conn); #endif // NET__SERVER_H