IPC/socket QUESTION...

Michael Hoefflinger hoff at en.ecn.purdue.edu
Sat Feb 9 02:05:20 AEST 1991


We interrupt the regularly scheduled high-level UNIX(tm) conversation
for this (seemingly) simple question:

   I'm using stream sockets to communicate between a client and a
   server process.  In the server I use a call to accept() to connect
   to a client socket in the server's request queue.

   --> The question is how do I make this accept() call NON-BLOCKING?  In
       other words, if there are no clients waiting to connect, I would
       like accept() to return with errno=EWOULDBLOCK instead of blocking
       until someone wants to connect.

   I've tried various attempts at setsockopt(), but nothing seems to
   do the trick.  I guess I could set up a timer interval interrupt,
   but that seems cludgy (sp?) at best.

   I assure you any ideas would be VERY MUCH APPRECIATED...

ADVthanksANCE

Michael Hoefflinger
"I'm not a EE grad student, but I play one on TV..."
hoff at ei.ecn.purdue.edu   (WYSE...)
uxg at fugue.cc.purdue.edu  (NeXT)



More information about the Comp.unix.programmer mailing list