Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!samsung!noose.ecn.purdue.edu!en.ecn.purdue.edu!hoff From: hoff@en.ecn.purdue.edu (Michael Hoefflinger) Newsgroups: comp.unix.programmer Subject: IPC/socket QUESTION... Keywords: IPC, socket, accept(), blocking Message-ID: <1991Feb8.150520.5678@en.ecn.purdue.edu> Date: 8 Feb 91 15:05:20 GMT Sender: hoff@ecn.purdue.edu Followup-To: comp.unix.programmer Distribution: na Organization: Purdue University Engineering Computer Network Lines: 24 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@ei.ecn.purdue.edu (WYSE...) uxg@fugue.cc.purdue.edu (NeXT)