mirror of
https://github.com/denoland/deno.git
synced 2025-01-08 23:28:18 -05:00
feat(cli/js/net): make rid on listener public (#5571)
This commit is contained in:
parent
d907133944
commit
6236252c66
3 changed files with 7 additions and 0 deletions
3
cli/js/lib.deno.ns.d.ts
vendored
3
cli/js/lib.deno.ns.d.ts
vendored
|
@ -1545,6 +1545,9 @@ declare namespace Deno {
|
||||||
/** Return the address of the `Listener`. */
|
/** Return the address of the `Listener`. */
|
||||||
readonly addr: Addr;
|
readonly addr: Addr;
|
||||||
|
|
||||||
|
/** Return the rid of the `Listener`. */
|
||||||
|
readonly rid: number;
|
||||||
|
|
||||||
[Symbol.asyncIterator](): AsyncIterableIterator<Conn>;
|
[Symbol.asyncIterator](): AsyncIterableIterator<Conn>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,8 @@ export interface Listener extends AsyncIterable<Conn> {
|
||||||
|
|
||||||
addr: Addr;
|
addr: Addr;
|
||||||
|
|
||||||
|
rid: number;
|
||||||
|
|
||||||
[Symbol.asyncIterator](): AsyncIterableIterator<Conn>;
|
[Symbol.asyncIterator](): AsyncIterableIterator<Conn>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ import {
|
||||||
assert,
|
assert,
|
||||||
assertEquals,
|
assertEquals,
|
||||||
createResolvable,
|
createResolvable,
|
||||||
|
assertNotEquals,
|
||||||
} from "./test_util.ts";
|
} from "./test_util.ts";
|
||||||
|
|
||||||
unitTest({ perms: { net: true } }, function netTcpListenClose(): void {
|
unitTest({ perms: { net: true } }, function netTcpListenClose(): void {
|
||||||
|
@ -11,6 +12,7 @@ unitTest({ perms: { net: true } }, function netTcpListenClose(): void {
|
||||||
assert(listener.addr.transport === "tcp");
|
assert(listener.addr.transport === "tcp");
|
||||||
assertEquals(listener.addr.hostname, "127.0.0.1");
|
assertEquals(listener.addr.hostname, "127.0.0.1");
|
||||||
assertEquals(listener.addr.port, 3500);
|
assertEquals(listener.addr.port, 3500);
|
||||||
|
assertNotEquals(listener.rid, 0);
|
||||||
listener.close();
|
listener.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue