OxL Reference

method TlsStream.connectHost

Resolves host (a name or numeric address), connects and runs the client handshake; cfg.serverName defaults to host.

Example:

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

fn open() -> TlsStream | NetError  net {
  TlsStream.connectHost("example.org", 443, timeout: 5s)
}
pub(api) static fn connectHost(host: str, port: u16, cfg: TlsConfig = TlsConfig{}, timeout: Duration? = none) -> TlsStream | NetError  net

Since. 1.0.0-beta

Parameters

NameType
hoststr
portu16
cfgTlsConfig = TlsConfig{}
timeoutDuration? = none

Returns

TlsStream

Errors

  • NetError
  • as `connect`; `Unavailable` when the name does not resolve.

Effects

net

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

See also