summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJoshua Flancer <jtflance@protonmail.com>2019-01-13 16:54:30 -0800
committerRyan Dahl <ry@tinyclouds.org>2019-01-13 19:54:30 -0500
commitfda604ff05f77711ee72c10bd3f40a01fc6ec6a3 (patch)
tree710e8681e776aa49f21c8096cc6e6171b96f8269 /js
parentb1c59d7231102b8f904cdfb6a621e306af301b9f (diff)
Added rid to Conn interface (#1513)
Diffstat (limited to 'js')
-rw-r--r--js/net.ts2
-rw-r--r--js/net_test.ts1
2 files changed, 3 insertions, 0 deletions
diff --git a/js/net.ts b/js/net.ts
index decbd5bea..76025869d 100644
--- a/js/net.ts
+++ b/js/net.ts
@@ -57,6 +57,8 @@ export interface Conn extends Reader, Writer, Closer {
localAddr: string;
/** The remote address of the connection. */
remoteAddr: string;
+ /** The resource ID of the connection. */
+ rid: number;
/** Shuts down (`shutdown(2)`) the reading side of the TCP connection. Most
* callers should just use `close()`.
*/
diff --git a/js/net_test.ts b/js/net_test.ts
index bf48b3448..4448b4cc1 100644
--- a/js/net_test.ts
+++ b/js/net_test.ts
@@ -22,6 +22,7 @@ testPerm({ net: true }, async function netDialListen() {
assertEqual(1, buf[0]);
assertEqual(2, buf[1]);
assertEqual(3, buf[2]);
+ assert(conn.rid > 0);
// TODO Currently ReadResult does not properly transmit EOF in the same call.
// it requires a second call to get the EOF. Either ReadResult to be an