I imagine it might be difficult sometimes depending on the protocol. IIRC TLS might sometimes require writes while reading.
I imagine it might be difficult sometimes depending on the protocol. IIRC TLS might sometimes require writes while reading.
Python has some of javas thinking through a standard convention on the method names for reading and writing (an interface!), but it seems common with departures from those simple rules when people get creative. From that perspective, an initiative like this is quite understandable and convenient. Nevertheless, I don't seem to feel the need in the same way in certain other languages.
OpenSSL exposes a "memory BIO", which is basically exactly this. You send in writes, and then emit data when you can, and in the meantime it buffers.
It's a bit more limited than that, but generally speaking it's not too bad.