Tls module

write

procedure · 2 overloadsSource

Sends all of bytes. On an error it returns how many went out. Sends all of bytes, waiting for the peer as needed, and returns how many went out with an Io.Io_Error. On .NONE that is bytes.count; on an error it is the bytes that were already sent. It is the same as write_some repeated, so a large write is split into records and may take several scheduler turns. Use write_some to send what fits without looping.

write :: (stream: *Tls_Stream, bytes: [] u8) -> (s64, Io.Io_Error)

Sends all of bytes. On an error it returns how many went out. Sends all of bytes, waiting for the peer as needed, and returns how many went out with an Io.Io_Error. On .NONE that is bytes.count; on an error it is the bytes that were already sent. It is the same as write_some repeated, so a large write is split into records and may take several scheduler turns. Use write_some to send what fits without looping.

Parameters

stream: *Tls_Stream
the stream to write to.
bytes: [] u8
the data to send.

Returns

s64
write :: (stream: *Tls_Stream, text: string) -> (s64, Io.Io_Error)

The write for a string: sends all of text and returns how many bytes went out.

Parameters

stream: *Tls_Stream
the stream to write to.
text: string
the string to send.

Returns

s64

See also