From fda604ff05f77711ee72c10bd3f40a01fc6ec6a3 Mon Sep 17 00:00:00 2001 From: Joshua Flancer Date: Sun, 13 Jan 2019 16:54:30 -0800 Subject: [PATCH] Added rid to Conn interface (#1513) --- js/net.ts | 2 ++ js/net_test.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/js/net.ts b/js/net.ts index decbd5bea1..76025869d4 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 bf48b34482..4448b4cc18 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