DoxigAlpha

writevAll

Deprecated in favor of Writer.

Function parameters

Parameters

#
iovecs:[]posix.iovec_const

Type definitions in this namespace

Types

#

Functions in this namespace

Functions

#
tcpConnectToHost
All memory allocated with `allocator` will be freed before this function returns.
getAddressList
Call `AddressList.deinit` on the result.

Error sets in this namespace

Error Sets

#

= switch (native_os) { .windows => builtin.os.version_range.windows.isAtLeast(.win10_rs4) orelse false, .wasi => false, else => true, }

Values

#
has_unix_sockets
= switch (native_os) { .windows => builtin.os.version_range.windows.isAtLeast(.win10_rs4) orelse false, .wasi => false, else => true, }

Source

Implementation

#
pub fn writevAll(self: Stream, iovecs: []posix.iovec_const) WriteError!void {
    if (iovecs.len == 0) return;

    var i: usize = 0;
    while (true) {
        var amt = try self.writev(iovecs[i..]);
        while (amt >= iovecs[i].len) {
            amt -= iovecs[i].len;
            i += 1;
            if (i >= iovecs.len) return;
        }
        iovecs[i].base += amt;
        iovecs[i].len -= amt;
    }
}