Deno.Listener

A generic network listener for stream-oriented protocols.

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

§Type Parameters

§
T extends Conn = Conn
[src]

§Extends

§
AsyncIterable<T>
[src]
§
Disposable
[src]

§Properties

§
readonly addr: Addr
[src]

Return the address of the Listener.

§
readonly rid: number
[src]

Return the rid of the Listener.

§Methods

§
[[Symbol.asyncIterator]](): AsyncIterableIterator<T>
[src]
§
accept(): Promise<T>
[src]

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

§
close(): void
[src]

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

§
ref(): void
[src]

Make the listener block the event loop from finishing.

Note: the listener blocks the event loop from finishing by default. This method is only meaningful after .unref() is called.

§
unref(): void
[src]

Make the listener not block the event loop from finishing.