OxL Reference

method TlsStream.read

Up to max bytes of application data. An empty result means the peer closed TLS cleanly (close_notify); a connection that ended without it is Unavailable. A Timeout leaves the stream usable.

Example:

oxl✓ checked in CI
use std.net { TlsStream }

fn first(s: &TlsStream) -> bytes | NetError  net {
  s.read(4096, timeout: 2s)
}
pub(api) fn read(max: usize, timeout: Duration? = none) -> bytes | NetError  net

Since. 1.0.0-beta

Parameters

NameType
maxusize
timeoutDuration? = none

Returns

bytes

Errors

  • NetError
  • `Timeout`, `Unavailable` (also: the peer ended without `close_notify`), `Cancelled`, `ProtocolError` (`tls alert:` ...).

Effects

net

Defined in: std/net/tls.oxl:262

See also