Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!male!yavin!mike_s From: mike_s@EBay.Sun.COM (Mike "Lakermaniac" Sullivan) Newsgroups: comp.unix.programmer Subject: Re: IPC/socket QUESTION... Keywords: IPC, socket, accept(), blocking Message-ID: Date: 10 Feb 91 01:52:29 GMT References: <1991Feb8.150520.5678@en.ecn.purdue.edu> <26803@uflorida.cis.ufl.EDU> Sender: news@male.EBay.Sun.COM Distribution: na Lines: 21 In <26803@uflorida.cis.ufl.EDU> leh@atlantis.cis.ufl.edu (Les Hill) writes: >--> The answer is to use fcntl() (or perhaps ioctl() on your machine) and set > the socket's descriptor to non-blocking. Under SunOS4.1.1 I would do > either > rc = fcntl(socket,F_SETFL,O_NDELAY); > or > rc = fcntl(socket,F_SETFL,FNDELAY); > both of which will do the Right Thing (tm). Actually, while close to right, I believe the Right Thing is to first read the flags, then set FNDELAY in addition to the current flags. flags = fcntl(socket, F_GETFL, 0); fcntl(socket, F_SETFL, flags | FNDELAY); Mike -- Mike Sullivan Internet: msullivan@EBay.Sun.COM Sun Education UUCP: ..!sun!yavin!msullivan Software Course Developer Compuserve: 75365,764