estdlib icon indicating copy to clipboard operation
estdlib copied to clipboard

ostream / streambuf sputn repeat until would-be blocked

Open malachib opened this issue 1 year ago • 0 comments

Currently the only time basic_ostream truly repeatedly calls xsputn is when timeout feature is on.

It's possible to get more mileage out of non-timeout mode if we continually call xsputn until it would want to block. At this time we can get a notion of that when overflow returns eof.

This is clumsy, however since it's indistinguishable from a transport error. We need to formalize the nodata / eol notion at the streambuf level. That will be a different issue to solve though.

For now, repeat-until-eof is an improvement over giving up right away when not all the bytes are written

malachib avatar Feb 11 '24 05:02 malachib