예제 #1
0
파일: test_fileserv.c 프로젝트: Zolok/refos
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();
}
예제 #2
0
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);
}