version 1.11, 2005/03/08 00:25:02
|
version 1.12, 2005/03/08 00:28:48
|
|
|
fds_recv = fds_openrecv; | fds_recv = fds_openrecv; |
fds_send = fds_opensend; | fds_send = fds_opensend; |
| |
select ( 0, &fds_recv, &fds_send, NULL, &zerotime ); |
wsa_ok ( select ( 0, &fds_recv, &fds_send, NULL, &zerotime ), SOCKET_ERROR !=, |
|
"select_server (%lx): select() failed: %d\n" ); |
| |
/* check for incoming requests */ | /* check for incoming requests */ |
if ( FD_ISSET ( mem->s, &fds_recv ) ) { | if ( FD_ISSET ( mem->s, &fds_recv ) ) { |
|
|
/* accept a single connection */ | /* accept a single connection */ |
tmp = sizeof ( mem->sock[i].peer ); | tmp = sizeof ( mem->sock[i].peer ); |
mem->sock[i].s = accept ( mem->s, (struct sockaddr*) &mem->sock[i].peer, &tmp ); | mem->sock[i].s = accept ( mem->s, (struct sockaddr*) &mem->sock[i].peer, &tmp ); |
wsa_ok ( mem->sock[i].s, INVALID_SOCKET !=, "select_server (%lx): accept failed: %d\n" ); |
wsa_ok ( mem->sock[i].s, INVALID_SOCKET !=, "select_server (%lx): accept() failed: %d\n" ); |
| |
ok ( mem->sock[i].peer.sin_addr.s_addr == inet_addr ( gen->inet_addr ), | ok ( mem->sock[i].peer.sin_addr.s_addr == inet_addr ( gen->inet_addr ), |
"select_server (%x): strange peer address\n", id ); | "select_server (%x): strange peer address\n", id ); |