1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#ifndef NET__COMMON_H #define NET__COMMON_H #include "../common.h" #include <netdb.h> #include <sys/socket.h> #include <netinet/tcp.h> typedef struct { int conn_socket_fd; } conn_t; struct sockaddr_in* get_addr(const char* addr, const char* port); int conn_configure_tcpalive(conn_t* conn); void conn_close(conn_t* conn); #endif // NET__COMMON_H