mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 15:24:46 -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`. */
|
||||
readonly addr: Addr;
|
||||
|
||||
/** Return the rid of the `Listener`. */
|
||||
readonly rid: number;
|
||||
|
||||
[Symbol.asyncIterator](): AsyncIterableIterator<Conn>;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,8 @@ export interface Listener extends AsyncIterable<Conn> {
|
|||
|
||||
addr: Addr;
|
||||
|
||||
rid: number;
|
||||
|
||||
[Symbol.asyncIterator](): AsyncIterableIterator<Conn>;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import {
|
|||
assert,
|
||||
assertEquals,
|
||||
createResolvable,
|
||||
assertNotEquals,
|
||||
} from "./test_util.ts";
|
||||
|
||||
unitTest({ perms: { net: true } }, function netTcpListenClose(): void {
|
||||
|
@ -11,6 +12,7 @@ unitTest({ perms: { net: true } }, function netTcpListenClose(): void {
|
|||
assert(listener.addr.transport === "tcp");
|
||||
assertEquals(listener.addr.hostname, "127.0.0.1");
|
||||
assertEquals(listener.addr.port, 3500);
|
||||
assertNotEquals(listener.rid, 0);
|
||||
listener.close();
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue