Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!psuvax1!brutus.cs.uiuc.edu!uakari.primate.wisc.edu!aplcen!uunet!sco!natei From: natei@sco.COM (Nathaniel Ingersoll) Newsgroups: comp.unix.wizards Subject: Re: sockets and select Keywords: socket select Message-ID: <4990@scolex.sco.COM> Date: 27 Feb 90 18:31:41 GMT References: <4309@helios.TAMU.EDU> <132218@sun.Eng.Sun.COM> Reply-To: natei@sco.COM (Nathaniel Ingersoll) Distribution: usa Organization: The Santa Cruz Operation, Inc. Lines: 28 In article <4309@helios.TAMU.EDU> dhess@cs.tamu.edu (David K Hess) asks why select() for reading on an NDELAY socket always seems to return a fact that the socket has data. The manual page: . . SELECT(S) UNIX System V SELECT(S) . ... . Description . select examines the I/O descriptor sets whose addresses are . passed in readfds, writefds, and exceptfds to see if some of . their descriptors are ready for reading, are ready for . writing, or have an exceptional condition pending, . respectively. The first nfds descriptors are checked in "Ready" for reading/writing probably means that the read or the write will filled without blocking, and since the NDELAY bit has been set, read() will always work without blocking. You should either (use NDELAY && not use select()) || (use select() && not NDELAY) -- ________________________________________________________________________________ I told the police that I was not injured, but on removing my hat, I found that I had a skull fracture. -- from an insurance accident form