Function readAtLeast [src]
Receives TLS-encrypted data from stream, which must conform to StreamInterface.
Returns the number of bytes read, calling the underlying read function the
minimal number of times until the buffer has at least len bytes filled.
If the number read is less than len it means the stream reached the end.
Reaching the end of the stream is not an error condition.
Prototype
pub fn readAtLeast(c: *Client, stream: anytype, buffer: []u8, len: usize) !usize
Parameters
c: *Client
buffer: []u8
len: usize
Source
pub fn readAtLeast(c: *Client, stream: anytype, buffer: []u8, len: usize) !usize {
var iovecs = [1]std.posix.iovec{.{ .base = buffer.ptr, .len = buffer.len }};
return readvAtLeast(c, stream, &iovecs, len);
}