static int test_file_server_serv_connect() { test_start("fs serv_connect"); for (int i = 0; i < 5; i++) { serv_connection_t c = serv_connect("/fileserv/*"); test_assert(c.error == ESUCCESS); test_assert(c.paramBuffer.err == ESUCCESS); strcpy(c.paramBuffer.vaddr, "test"); serv_disconnect(&c); } return test_success(); }
void serv_stop() { struct node *node; struct node *last; node = clients->first; while(node != NULL) { serv_send("exit", *(node->client)); serv_disconnect(node->client); last = node; node = node->next; free(last); } free(clients); close(*listen_socket); free(listen_socket); free(listen_server); }