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

method TlsListener.handshake

Runs the server handshake on a connection from acceptTcp (which it consumes).

Example:

oxl✓ проверяется в CI
use std.net { TlsListener, TlsStream }

fn upgrade(l: &TlsListener) -> TlsStream | NetError  net {
  let tcp = l.acceptTcp()?
  l.handshake(tcp, 2s)
}
pub(api) fn handshake(tcp: TcpStream, timeout: Duration? = none) -> TlsStream | NetError  net

С версии. 1.0.0-beta

Параметры

ИмяТип
tcpTcpStream
timeoutDuration? = none

Возвращает

TlsStream

Ошибки

  • NetError
  • `ProtocolError` (`tls handshake:` ...), `Timeout`.

Эффекты

net

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

См. также