method TlsStream.connectHost
Resolves host (a name or numeric address), connects and runs the client handshake; cfg.serverName defaults to host.
Example:
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 netSince. 1.0.0-beta
Parameters
Returns
Errors
NetError- as `connect`; `Unavailable` when the name does not resolve.
Effects
net
Defined in: std/net/tls.oxl:240