Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!mintaka!snorkelwacker.mit.edu!thunder.mcrcim.mcgill.edu!mouse From: mouse@thunder.mcrcim.mcgill.edu (der Mouse) Newsgroups: comp.unix.programmer Subject: Re: Out of band data Message-ID: <1991Feb28.180055.1280@thunder.mcrcim.mcgill.edu> Date: 28 Feb 91 18:00:55 GMT References: <483sis-d@massey.ac.nz> Organization: McGill Research Centre for Intelligent Machines Lines: 43 In article <483sis-d@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@larry.mcrcim.mcgill.edu