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

method TlsListener.acceptTcp

Accepts the next TCP connection without TLS; finish it with handshake.

Example:

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

fn first(l: &TlsListener) -> bool net {
  match l.acceptTcp(1s) {
    TcpStream t => {
      _ = t.close()
      true
    }
    NetError _ => false
  }
}
pub(api) fn acceptTcp(timeout: Duration? = none) -> TcpStream | NetError  net

С версии. 1.0.0-beta

Параметры

ИмяТип
timeoutDuration? = none

Возвращает

TcpStream

Ошибки

  • NetError
  • `Timeout`, `Cancelled`, `Unavailable`.

Эффекты

net

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

См. также