sockets and select

David K Hess dhess at cs.tamu.edu
Fri Feb 23 08:44:37 AEST 1990


	This is a question for anyone who has worked heavily with
sockets.  I am working on a SparcStation1 under SunOS 4.0.3c. I am
using multiple sockets to talk back and forth between processes on
different machines (Internet domain sockets). All the sockets are
marked non-blocking (i.e.  fcntl(fd,F_SETFL, FN_DELAY)). The socket
options set are SO_KEEPALIVE and ~SO_LINGER.

	When I perform select() calls for reading only, strange
things happen. At first the call works correctly and I empty the
socket and do another select.  Then after a while, when I perform a
recv() on the "selected" socket I get 0 bytes.  Yet when I select
again I get the same socket ready for reading.  Pretty soon they are
all doing it and select() has become as useful as polling.

Has anybody run into this before? Does anybody have a fix or 
work around? Is there anything I might be doing wrong that might 
provoke this behavior?

        Any help would be appreciated.



More information about the Comp.unix.wizards mailing list