OxL Справочник OxL
РусскийEnglish

method TlsStream.connectHost

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

Example:

oxl✓ проверяется в 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

С версии. 1.0.0-beta

Параметры

ИмяТип
hoststr
portu16
cfgTlsConfig = TlsConfig{}
timeoutDuration? = none

Возвращает

TlsStream

Ошибки

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

Эффекты

net

Определено в: std/net/tls.oxl:240

См. также