Luke Mewburn <lukemat_private> writes: > Many TCP servers open a TCP socket in the default blocking mode, use > select(2) to wait for connections, and then accept(2) connections in > blocking mode. Under some circumstances, the accept(2) may hang > waiting for another connection, denying service to clients trying to > connect to other ports. [...] > Two solutions are possible: > > 1) Modify all TCP servers to use non-blocking listening sockets. > Unfortunately, this requires changing a large amount of code, much > of it maintained by third parties. This has been in the UNIX Sockets FAQ for quite some time: http://kipper.york.ac.uk/~vic/sock-faq/sfaq.html#faq16 | On some other implementations, accept seemed to be capable of | blocking if this occured. This is important, since if select() said | the listening socket was readable, then you would normally expect | not to block in the accept() call. The fix is, of course, to set | nonblocking mode on the listening socket if you are going to use | select() on it. ttfn/rjk
This archive was generated by hypermail 2b30 : Fri Apr 13 2001 - 14:29:37 PDT