deno / 1.23.2 / ~ / deno.listener.html /

Deno.Listener

A generic network listener for stream-oriented protocols.

interface Listener extends AsyncIterable<Conn> {
readonly addr : Addr;
readonly rid : number;
[[Symbol.asyncIterator]]() : AsyncIterableIterator<Conn>;
accept() : Promise<Conn>;
close() : void;
}

Extends

AsyncIterable<Conn>

Properties

readonly addr : Addr

Return the address of the Listener.

readonly rid : number

Return the rid of the Listener.

Methods

[[Symbol.asyncIterator]]() : AsyncIterableIterator<Conn>
accept() : Promise<Conn>

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

close() : void

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

© 2018–2022 the Deno authors
https://doc.deno.land/deno/stable/~/Deno.Listener