Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!sdd.hp.com!caen!hellgate.utah.edu!dog.ee.lbl.gov!elf.ee.lbl.gov!torek From: torek@elf.ee.lbl.gov (Chris Torek) Newsgroups: comp.unix.programmer Subject: Re: Question about sockets (asynch) Message-ID: <14075@dog.ee.lbl.gov> Date: 8 Jun 91 19:13:22 GMT References: <3449@mtecv2.mty.itesm.mx> Reply-To: torek@elf.ee.lbl.gov (Chris Torek) Organization: Lawrence Berkeley Laboratory, Berkeley Lines: 21 X-Local-Date: Sat, 8 Jun 91 12:13:22 PDT In article mycroft@kropotki.gnu.ai.mit.edu (Charles Hannum) writes: >If you use NULL for the timeout argument to select(2), it should wait >for one of the file descriptors to become ready. If you pass it a >pointer to an integer set to 0, it will exit immediately. Setting the >files to non-blocking I/O should not make any difference. Actually, that is a `pointer to a struct timeval'. This is otherwise correct. Select is not supposed to base its `readiness' decision on blocking/nonblocking modes; however, there have been some implementation goofs in the past in this respect. If you are stuck with one of those you might have to clear nonblocking mode for the duration of the select call. In general, there is no reason to mix select and nonblocking I/O: since select tells you which descriptors will not block, you can simply avoid operations on those descriptors. There are special cases, though (shared descriptors, e.g.). -- In-Real-Life: Chris Torek, Lawrence Berkeley Lab CSE/EE (+1 415 486 5427) Berkeley, CA Domain: torek@ee.lbl.gov