Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!think.com!mintaka!ai-lab!life.ai.mit.edu!mycroft From: mycroft@kropotki.gnu.ai.mit.edu (Charles Hannum) Newsgroups: comp.unix.programmer Subject: Re: Question about sockets (asynch) Message-ID: Date: 8 Jun 91 06:21:48 GMT References: <3449@mtecv2.mty.itesm.mx> Sender: news@ai.mit.edu Organization: /home/fsf/mycroft/.organization Lines: 12 In-reply-to: rbanos@mtecv2.mty.itesm.mx's message of 7 Jun 91 21:25:52 GMT In article <3449@mtecv2.mty.itesm.mx> rbanos@mtecv2.mty.itesm.mx (Roberto A. Banos Alvarez) writes: I have a process that has to listen for streams and datagrams. Obviusly, (I think) I can't have a blocking-accept for either stream or datagram msg. So, I decided to have two different sockets with non-blocking accepts and a loop with a select to test if there's a message pending. This works OK, but it loads the system. 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.