|
Boost : |
From: Maxim Yegorushkin (e-maxim_at_[hidden])
Date: 2005-06-13 02:20:09
On Sat, 11 Jun 2005 02:10:49 +0400, Aaron W. LaFramboise
<aaronrabiddog51_at_[hidden]> wrote:
> Simon Richter wrote:
[]
> In other words, I'd suggest we forget about iostreams. Design a good
> socket based on past experience that handles diverse networking
> situations elegantly, and let some other library like Boost.Iostreams
> map that to a streambuf, should <iostream> support be needed.
I agree whole-heartedly. Sockets are naturally binary and confining them
in clumsy text-oriented IOStreams interface is IMHO rather a bad idea.
Also, one can not just wrap a TCP socket in an std::iostream, feed it to
code writing into std::ostream and expect good performance. The reason is
TCP mechanics: you pretty much always need corking (TCP_CORK), so you'll
end up having to output an intermediate IO manipulator before the actual
output, so that it corks up the socket upon construction and uncork it
upon destruction, or having to use a corked socket by default and uncork
it in ostream::flush. Say good bye to genericity...
-- Maxim Yegorushkin
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk