function UnixStream.close
Close the stream. A TLS stream tells its peer first. Closing twice is harmless; any other use after closing fails. A stream that is dropped closes by itself.
function UnixStream.flush
Send whatever is buffered. A TLS stream buffers the records it encrypts; a plain socket has nothing to flush.
function UnixStream.local_addr
The path this end is bound to, or
None for an unnamed socket.
function UnixStream.peer_addr
The path the peer is bound to, or
None for an unnamed socket, as a connecting client’s usually is.
function UnixStream.read
Read at most
n bytes, and at most 64 KiB: whatever arrives first, at least one byte unless the peer has closed its end, where it returns b"". Call it again for more.
function UnixStream.read_exact
Read exactly
n bytes. A peer that closes first fails it with kind == "unexpected_eof".
function UnixStream.read_to_end
Read until the peer closes its end.
function UnixStream.read_to_string
Read until the peer closes its end, as text. Bytes that are not UTF-8 fail it with
kind == "invalid_data".
function UnixStream.set_read_timeout
Fail any later read that waits longer than
timeout_ms with kind == "timed_out". None waits as long as the OS does.
function UnixStream.set_write_timeout
Fail any later write that waits longer than
timeout_ms with kind == "timed_out". None waits as long as the OS does.
function UnixStream.shutdown
Shut down the
"read" half, the "write" half, or "both". After shutting down writes, the peer reads the end of the stream: the way to tell a peer that waits for it that the request is complete. A TLS stream tells its peer first, so the end is not mistaken for a cut.
function UnixStream.try_flush
flush, returning an (err, None) pair instead of raising a std.io.Error.
function UnixStream.try_local_addr
local_addr, returning an (err, str | None) pair instead of raising a std.io.Error.
function UnixStream.try_peer_addr
peer_addr, returning an (err, str | None) pair instead of raising a std.io.Error.
function UnixStream.try_read
read, returning an (err, bytes) pair instead of raising a std.io.Error.
function UnixStream.try_read_exact
read_exact, returning an (err, bytes) pair instead of raising a std.io.Error.
function UnixStream.try_read_to_end
read_to_end, returning an (err, bytes) pair instead of raising a std.io.Error.
function UnixStream.try_read_to_string
read_to_string, returning an (err, str) pair instead of raising a std.io.Error.
function UnixStream.try_set_read_timeout
set_read_timeout, returning an (err, None) pair instead of raising a std.io.Error.
function UnixStream.try_set_write_timeout
set_write_timeout, returning an (err, None) pair instead of raising a std.io.Error.
function UnixStream.try_shutdown
shutdown, returning an (err, None) pair instead of raising a std.io.Error.
function UnixStream.try_write
write, returning an (err, int) pair instead of raising a std.io.Error.
function UnixStream.try_write_all
write_all, returning an (err, None) pair instead of raising a std.io.Error.
function UnixStream.write
Write some of
data and return how many bytes were written, which can be fewer than len(data). Use write_all to write all of it.
function UnixStream.write_all
Write all of
data, a string or bytes.
