
On Tue, Apr 26, 2005 at 02:31:43AM +0300, Boris wrote:
Rob Stewart wrote: [snip]
However I withdraw the idea of non-blocking I/O support in socket streams anyway as we can't know with the standard interface if "s << a" fails partially.
Whether it is non-blocking or not is AFAICS is irrelevant. if is sizeof char then a is not in the buffer and the failure is because of buffer write. if a is > size of char then some part of a is in the buffer upto the point that the buffer overflows. If you know the sizeof the buffer, where you are in the buffer and the size of a then you know how much of a is in the buffer. However, only a fool would allow the buffer to overflow across a single <<.
I don't know how many developers require non-blocking unformatted I/O functions. I think most developers like streams because of code like "s << a << b << c << d". It's probably not worth the effort to support non-blocking unformatted I/O functions. If anyone thinks differently he should tell us now! :)
Blocking or non-blocking iiuc is irrelevant. And you want formatted I/O to do marshalling which is the main advantage of iostreams. /ikh