Socket programming in C, using the select() function
问题 Based from the answers I got from this thread, I've created this: //Server sock_init(); //from SFL, see http://legacy.imatix.com/html/sfl/ timeout = 50000; serv_sock_input[0] = TCP(1234); serv_sock_input[1] = UDP(9876); input_protocols[0] = "tcp"; input_protocols[1] = "udp"; while (1) { FD_ZERO(&sock_set); for (x = 0; x<number_of_inputs; x++) { FD_SET(serv_sock_input[x], &sock_set); } select_timeout.tv_sec = timeout; select_timeout.tv_usec = 0; if (select(0, &sock_set, NULL, NULL, &select