|
Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006
Several problems Socket Programming A socket procedures, recently found a rather strange question :
1. As a server, the client is connected to select acceptable mistake to withdraw from the process at this time errno to EBADF
[code]
4003rd set up multi-select IO wait time
Select_time.tv_sec = 1;
Select_time.tv_usec = 0
4003rd installed select a mistake waiting time
Sleeptime.tv_sec = 1;
Sleeptime.tv_usec = 0
FD_ZERO (&rfds);
FD_SET (port_fd, &rfds);
Int nfds port_fd + = 1;
4003rd I/O multiplexing, waiting to be ready for any descriptors
Rc = select (nfds, &rfds, NULL, NULL, &select_time);
If (rc ====== 1)
{
Switch (errno)
{
EBADF case :
4003rd from the mistakes
Break;
EINTR case :
Continue;
...
Default :
Continue;
}
}[/code]
2. As a client to connect to a certain address, a port success and then withdraw from (close to the corresponding socket descriptor), but not able to successfully connect calls to the socket
The close link, I used to check the pfiles process, finding the corresponding address and port are still in use.
We do not know whether the prawn encountered similar situations? |
| |