Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!wuarchive!rex!samsung!noose.ecn.purdue.edu!en.ecn.purdue.edu!hoff From: hoff@en.ecn.purdue.edu (Michael Hoefflinger) Newsgroups: comp.unix.programmer Subject: IPC/Sockets and blocking revisited...[THANKS] Summary: thanks for the help Keywords: IPC, sockets, blocking Message-ID: <1991Feb16.225731.20445@en.ecn.purdue.edu> Date: 16 Feb 91 22:57:31 GMT Sender: hoff@ei.ecn.purdue.edu Distribution: na Organization: Purdue University Engineering Computer Network Lines: 28 Just wanted to take a moment to thank all the kind folks that took a minute to write me about the non-blocking socket question I had. The solution, courtesy of both Les Hill and Mike "Lakermaniac (not such a good game agains Boston, eh?)" Sullivan: flags = fcntl (socket, F_GETFL, 0); fcntl (socket, F_SETFL, flags | FNDELAY); This was indeed the Right Thing (tm) to do, and the Right Time (tm) to do it. Since I got such a quick and working response on my last question, I think I will abuse this living user's manual some more: --> Question is, how can I execute a getchar() that will return with EOF immediately if the user has not typed anything, or with the char as soon as it is typed? The problem is that getchar is buffered I/O, and apparently _fillbuf() doesn't exit back to getchar until a carriage return is executed. Appreciate your time. And thanks again... Michael Hoefflinger EE, Purdue University (hoff@ecn.purdue.edu, uxg@fugue.cc.purdue.edu) "I'm not really a EE grad student, but I played one on TV."