OxL Reference

method TlsListener.acceptTcp

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

Example:

oxl✓ checked in 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

Since. 1.0.0-beta

Parameters

NameType
timeoutDuration? = none

Returns

TcpStream

Errors

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

Effects

net

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

See also