void socketlist_free(struct socketlist* head) { struct socket* s; while ((s = socketlist_remove(head)) != 0) socket_free(s); }
void close_socket(int s) { network_close(s); socketlist_remove(s); disconnectfunction_exec(s); }