version 1.4, 2005/03/06 22:17:33
|
version 1.7, 2005/03/06 22:25:41
|
|
|
FD_ZERO ( &fds_recv ); | FD_ZERO ( &fds_recv ); |
FD_ZERO ( &fds_send ); | FD_ZERO ( &fds_send ); |
FD_ZERO ( &fds_opensend ); | FD_ZERO ( &fds_opensend ); |
|
|
FD_SET ( mem->s, &fds_openrecv ); | FD_SET ( mem->s, &fds_openrecv ); |
| |
while(1) | while(1) |
|
|
| |
} else if ( !FD_ISSET ( mem->sock[i].s, &fds_openrecv ) | } else if ( !FD_ISSET ( mem->sock[i].s, &fds_openrecv ) |
&& FD_ISSET ( mem->sock[i].s, &fds_send ) ) { | && FD_ISSET ( mem->sock[i].s, &fds_send ) ) { |
|
|
/* Echo data back */ | /* Echo data back */ |
mem->sock[i].n_sent = do_nonblocking_send ( i, (mem->sock[i].n_sent == 0), mem->sock[i].s, mem->sock[i].buf, n_expected, par->buflen ); | mem->sock[i].n_sent = do_nonblocking_send ( i, (mem->sock[i].n_sent == 0), mem->sock[i].s, mem->sock[i].buf, n_expected, par->buflen ); |
| |
|
|
128 | 128 |
} | } |
}, | }, |
/* Test 2: event-driven client, non-blocking server via select() */ |
/* Test 2: synchronous client, non-blocking server via select() */ |
{ | { |
{ | { |
STD_STREAM_SOCKET, | STD_STREAM_SOCKET, |