Out of band data

der Mouse mouse at thunder.mcrcim.mcgill.edu
Fri Mar 1 05:00:55 AEST 1991


In article <483sis-d at massey.ac.nz>, ...!cc-server4.massey.ac.nz!A.J.Rasiah writes:

> I am trying to use the out-of-band (OOB) facility of UNIX sockets.  I
> tried a

> 	send(s, "out of band data", 16, MSG_OOB);       /* 1 */
> 	write(s, "string 2", 8);         		/* 2 */

You don't say what flavor of UNIX, though with sockets and MSG_OOB it
clearly has Berkeley blood in its veins.

You also don't say what sort of socket.  It's clearly a stream socket,
but is it AF_UNIX or AF_INET?

I don't know what AF_UNIX does with MSG_OOB.  I've neither tried it nor
looked at the code.

But AF_INET, now, that's a different story.

You see, TCP doesn't have out-of-band data.  It has an urgent pointer,
which marks a point in the data stream, *not* a subsequence of the data
stream.  Berkeley took this notion and managed to turn it into a
sort-of OOB mechanism.  But the underlying mechanism is really not
suited to sending OOB data, so it's hardly surprising that it breaks.
And then various vendors ship code that isn't quite the Berkeley code
any longer, so it's broken in subtle ways....

If the sender and receiver use different implementations of TCP, this
is even less surprising.  The Berkeley code contains a comment that
seems to indicate that they violate the TCP spec slightly, in a way
that seems to me likely to cause interoperability problems with this
pseudo-OOB mechanism, and in fact I've observed problems that I can
pretty much justify as being caused by this.

If you really want a second data channel, I would recommend creating a
second connection.  If you want something else, it depends on just what
it is you want.

					der Mouse

			old: mcgill-vision!mouse
			new: mouse at larry.mcrcim.mcgill.edu



More information about the Comp.unix.programmer mailing list