Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!psuvax1!uwm.edu!cs.utexas.edu!helios!cs.tamu.edu!dhess From: dhess@cs.tamu.edu (David K Hess) Newsgroups: comp.unix.wizards Subject: sockets and select Keywords: socket select Message-ID: <4309@helios.TAMU.EDU> Date: 22 Feb 90 21:44:37 GMT Sender: usenet@helios.TAMU.EDU Reply-To: dhess@cs.tamu.edu (David K Hess) Distribution: usa Organization: Computer Science Department, Texas A&M University Lines: 20 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.