amber/listener

Types

pub type Listener

Values

pub fn accept(
  listener: Listener,
) -> promise.Promise(Result(tcp_conn.TcpConn, error.Error))

Waits for and resolves to the next connection to the Listener.

pub fn addr(of listener: Listener) -> net_addr.NetAddr

Return the address of the Listener.

pub fn close(listener: Listener) -> Result(Nil, error.Error)

Close closes the listener. Any pending accept promises will be rejected with errors.

pub fn ref(listener: Listener) -> Nil

Make the listener block the event loop from finishing.

pub fn unref(listener: Listener) -> Nil

Make the listener not block the event loop from finishing.

Search Document