Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!psuvax1!brutus.cs.uiuc.edu!samsung!uunet!servio!penneyj From: penneyj@servio.UUCP (D. Jason Penney) Newsgroups: comp.unix.wizards Subject: Re: sockets and select Keywords: socket select Message-ID: <380@servio.UUCP> Date: 28 Feb 90 19:33:48 GMT References: <4309@helios.TAMU.EDU> <132218@sun.Eng.Sun.COM> <4990@scolex.sco.COM> Reply-To: penneyj@servio.UUCP (D. Jason Penney) Distribution: usa Organization: Servio Logic Development Corp.; Beaverton, OR Lines: 25 In article <4990@scolex.sco.COM> natei@sco.com writes: >"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) >-- If I came across a system that did this, I would regard it as horribly broken. I use select() on non-blocking sockets in SunOS 4.0, Ultrix, Sony NEWS-OS, AIX, and other places, and on NONE of them does select() return a bit in readfd's unless there is at least one byte to read. Since 0 bytes is used in both nonblocking and blocking mode to indicate eof, if I saw that a socket was ready to read with 0 bytes left to read in it, I would immediately close() it. --J -- D. Jason Penney Ph: (503) 629-8383 Beaverton, OR 97006 uucp: ...uunet!servio!penneyj (penneyj@slc.com) "Computers are useless; they can only give answers" -- Picasso