You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
read 3 first byte of the buffer link to the channel, and if we redo channel.read(3) that read the next 3 byte of the buffer for this channel right ?
From a FP/ZIO point of view is it not a huge issue ?
How can I simply perform for example, an recursive/fold read of the channel with chunk of byte ?
What i mean, i have channel with X bytes, i decide to use 80 byte buffer, to be sure i read all, i need to iterate on my channel until it say me "ok you read all" (equivalent to buffer return -1).
The text was updated successfully, but these errors were encountered:
@ubourdon I don't think there is any concept of "read all" from a Socket's point of view.
Socket's keep sending and receiving messages until they are closed. Buffer's, on the other hand, have a finite capacity and so have a concept of "final" and "end of file".
Typically if you are implementing an HTTP server, you "reading" any message that comes in, until a \r\n is received, which will mark the end of an HTTP request.
I talk from zio.nio part of the lib (not core)
If i understand correclty,
channel.read
read 3 first byte of the buffer link to the channel, and if we redo
channel.read(3)
that read the next 3 byte of the buffer for this channel right ?From a FP/ZIO point of view is it not a huge issue ?
How can I simply perform for example, an recursive/fold read of the channel with chunk of byte ?
What i mean, i have channel with X bytes, i decide to use 80 byte buffer, to be sure i read all, i need to iterate on my channel until it say me "ok you read all" (equivalent to buffer return -1).
The text was updated successfully, but these errors were encountered: