home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.wizards
- Path: sparky!uunet!island!coney!hue
- From: hue@island.COM (Pond Scum)
- Subject: Re: Out-of-band data on sockets
- Message-ID: <hue.712262869@coney>
- Sender: usenet@island.COM (The Usenet mail target)
- Organization: Island Graphics Corp.
- References: <1992Jul17.090725.246@gamelan> <1992Jul21.141619.12933@Newbridge.COM>
- Date: Mon, 27 Jul 1992 18:47:49 GMT
- Lines: 33
-
- todds@Newbridge.COM (Todd Sandor) writes:
- >Similiar problems exist with SunOS 4.1.1. With SunOS, the select returnsindicating OOB data, then read the OOB data (all is OK), then go into
- >the select again and select returns with OOB data pending (nothing
- >has been sent). If try to read the OOB data you get a an error with
- >errno indicating an Invalid argument.
-
- You can clear the exception by doing a normal recv after you do the recv
- with MSG_OOB. I've got the following two fragments of code in one of my
- programs:
-
- send(s, &m, 1, MSG_OOB);
- send(s, &m, 1, 0); /* wizard test - what do you think this is for? */
- /* hint: see source code to telnet */
-
- and
-
- if ((n = select(nfds, 0, 0, &emask, &zerot)) > 0)
- {
- if ((n = recv(sock, buf, sizeof(buf), MSG_OOB)) < 0)
- perror("recv");
- read(sock, buf, 1); /* wizard test - What do you think this is for? */
-
-
- I send a useless byte of garbage so the receiver can read it and clear the
- exception.
-
- >(Problem is the select with exception-fd enabled will ALWAYS return with
- >something to read after the first OOB data is received - reading the
- >OOB data makes no difference).
-
- This is under SunOS 4.1.1.
-
- -Jonathan hue@island.COM
-