W3cubDocs

/Deno

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–2021 the Deno authors
https://doc.deno.land/deno/stable/~/Deno.Listener