From: Iain K. Hanson (iain.hanson_at_[hidden])
Date: 2005-04-27 08:40:16
On Tue, 2005-04-26 at 12:57 -0400, Rob Stewart wrote:
> From: "Iain K. Hanson" <ikh_at_[hidden]>
> > Using iostreams there must be a buffer ( usually a streambuf ). The buffer size
> > *must* be equal tp the MSS / path MTU.
> > As the application protocol writter you have to know how much you have written to
> > the buffer *at all times* and you must know when an overflow / flush will happen.
> > Errors can *only* happen when the buffer writes to the socket ( overflow/flush )
> > therefore if a programmer does his/her job correctly there will not be multiple
> > operator << traversing and overflow boundary. This is irrespective of sync/async.
> According to this, there is no way to use streams with sockets.
> Otherwise, clients of the stream interface would need to keep
> track of the size of formatted output of each object inserted on
> the stream to avoid overflow between insertion operators. How
> can they do that?
No. But see my previous post for an explanation of how it works. BTW the
only formatting I think a socket stream should do is marshaling and that
does not effect the number of bytes written when doing things in network
Whether you could use streams with say XDR / BER / DER / PER / CDR
marshaling I don't know ( at the moment ) and given that I am working on
socket wrappers at the moment, it is not something I intend to give a
great deal of consideration just now.
This email has been scanned for all known viruses by the MessageLabs Email
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk