home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.programmer:4262 comp.unix.questions:10018
- Path: sparky!uunet!sun-barr!cs.utexas.edu!swrinde!mips!sdd.hp.com!ux1.cso.uiuc.edu!news.cso.uiuc.edu!void!ejohnson
- From: ejohnson@void.ncsa.uiuc.edu (Eric E. Johnson)
- Newsgroups: comp.unix.programmer,comp.unix.questions
- Subject: Sockets: Non Blocking I/O, How do I know when its done?
- Message-ID: <ejohnson.713655821@void>
- Date: 12 Aug 92 21:43:41 GMT
- Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
- Organization: University of Illinois at Urbana
- Lines: 23
-
- I've been working with sockets for a few months, and I've been
- trying to do some non blocking sockets. But, I don't know what to
- "watch for" when the socket completes.
-
- I turn the socket into a non blocking socket by the following command.
-
- fcntl(s,F_SETFL,FNDELAY);
-
- When I use a
-
- result = read(s,buffer,nbytes);
-
- The errno is indeed set to EWOULDBLOCK, but *how* do I check to see
- when the data is in, or when the call is completed? I tried a while
- loop wrapped around the read, and watched errno to see if it became 0,
- or result returned >0, neither of which happened.
-
- Is there function call to make that returns the status of socket in
- non blocking mode?
-
- Thanks
-
- Eric
-