Re: [streams] Support reading bytes into buffers allocated by user code on platforms where only async read is available (#253)

>> If write() may return after writing only partial data, write() needs to return how many bytes have been written.
>
> I don't think write() should return after writing only partial data. But maybe this is because of my ignorance of the native APIs involved. I will go do some reading on them to make sure that what I envision fits with them.

I see. Using send(2), `send(fd, msg, len, flags)` could return a value less than `len`. But you can fairly easily layer a [sendall](http://beej.us/guide/bgnet/output/html/multipage/advanced.html#sendall) on top. I think it is OK that if the stream errors, a partial write occurred, since in our model an error is fatal.

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/253#issuecomment-77043481

Received on Tuesday, 3 March 2015 21:48:48 UTC