On Fri, Mar 16, 2012 at 19:36, Russ Cox <[email protected]> wrote:
> On Fri, Mar 16, 2012 at 7:40 AM, Ciprian Dorin Craciun
> <[email protected]> wrote:
>> Why was I puzzled: because as a non Plan9 user / developer, I
>> usually think of the underlaying transport technology (be it sockets
>> or 9p) as a stream of bytes without explicit framing.
>
> Even outside Plan 9, this is not always the case.
> UDP, IP, ethernet, Unix datagram sockets, email, HTTP.
> They're all message-based protocols.
>
> Russ
I am aware that there are other types of transports with other
semantics. Nevertheless I guess that at least 90% of the existing
protocols are built directly on top of stream based transports than
datagram ones. (I'm not speaking of ubiquity / underlaying technology,
or else we'd conclude that we use Ethernet in 99.999% of the cases.)
And what is even more funny, is that I guess a good majority of the
protocols are in the end message-based (as you've mentioned HTTP,
SMTP, etc.) although they are built ontop of a stream based protocol.
Furthermore 9p exposes a semantic more similar with TCP than with
UDP, and only when you take into account the read / write atomicity
you see it as a datagram protocol.
My concert was that in general a programmer used to implement
things ontop of stream based protocols was "thought" to expect that
one read on the client is not in general one read on the server due to
fragmentation, etc., and that he must frame his messages accordingly.
Thus my question was if when working with 9p it is a good choice
to do explicit framing (as in the case building ontop of TCP) or to
take for granted the read / write atomicity.
Ciprian.