Import std.net.tls
TlsListener
class
Public Class TlsListener
Takes TCP connections at an address and accepts each as its TlsServer does, giving them as TlsStreams over TcpStreams. It closes when it goes, or at Close.
-
@PanicsAtCaller Public Static Method Listen(address: SocketAddress, server: TlsServer, backlog: Int = BACKLOG): TlsListener Throws NetErrorstatic method #Listens at
addressasserver, as TcpListener.Listen does. Panics for a backlog below 1. -
@PanicsAtCaller Public Static Method Listen(host: String, port: UInt16, server: TlsServer, backlog: Int = BACKLOG): TlsListener Throws NetErrorstatic method #Listens at
host's first address andportasserver. Panics for a backlog below 1. -
Where it listens, the port the OS picked included.
-
Public Method Accept(timeout: Duration? = Null): TlsStream<TcpStream> Throws NetError, TimeoutErrormethod #The next connection, once its handshake is done, waiting up to
timeoutfor a TCP connection and its handshake, or as long as they take for a Null one. A client whose handshake fails throws here, as a NetError, or as a TimeoutError when it's too slow fortimeout, after which the listener takes the next one. -
Public Async Method AcceptAsync(timeout: Duration? = Null): TlsStream<TcpStream> Throws NetError, TimeoutErrormethod #Accept's Async twin, which waits on the main thread.
-
Closes it at once, as a TcpListener closes.
Report an issue with this page or with FutureBlitz on GitHub.