示例#1
0
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);
  }
}
示例#2
0
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);
}
示例#3
0
文件: client.c 项目: unixwitch/nts
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;
}
示例#4
0
void
client_reset(struct client *c) {

	c->buffer_got = c->buffer_sz = 0;
	client_listen(c, on_available_header);
}