1 #ifndef _CONNECTIONS_H_ 2 #define _CONNECTIONS_H_ 3 4 #include "server.h" 5 #include "fdevent.h" 6 7 connection *connection_init(server *srv); 8 int connection_reset(server *srv, connection *con); 9 void connections_free(server *srv); 10 11 connection * connection_accept(server *srv, server_socket *srv_sock); 12 int connection_close(server *srv, connection *con); 13 14 int connection_set_state(server *srv, connection *con, connection_state_t state); 15 const char * connection_get_state(connection_state_t state); 16 const char * connection_get_short_state(connection_state_t state); 17 int connection_state_machine(server *srv, connection *con); 18 19 #endif 20