0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 09:31:22 -05:00

Added rid to Conn interface (#1513)

This commit is contained in:
Joshua Flancer 2019-01-13 16:54:30 -08:00 committed by Ryan Dahl
parent b1c59d7231
commit fda604ff05
2 changed files with 3 additions and 0 deletions

View file

@ -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()`.
*/

View file

@ -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