Question about sockets (asynch)

Charles Hannum mycroft at kropotki.gnu.ai.mit.edu
Sat Jun 8 16:21:48 AEST 1991


In article <3449 at mtecv2.mty.itesm.mx> rbanos at 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.



More information about the Comp.unix.programmer mailing list