static void listen_thread(void *arg){ Client *client = (Client *) arg; char s[MAXLINE]; while(true){ strcpy(s, client_listen(client)); fprintf(stdout, "%s\n", s); } }
void merkle_disk_server::init_listen (int port) { // listen on unix domain socket for sampled requests int tcp_fd = inetsocket (SOCK_STREAM, port); if (tcp_fd < 0) { fatal << "Error creating client socket (TCP) " << strerror (errno) << "\n"; } client_listen (tcp_fd); }
int client_run() { if (client_listen() == -1) return -1; uv_timer_init(loop, &timeout_timer); uv_timer_start(&timeout_timer, client_handle_timeouts, 10000, 10000); incoming_run(); return 0; }
void client_reset(struct client *c) { c->buffer_got = c->buffer_sz = 0; client_listen(c, on_available_header); }