stabilize net Addr (#3709)

Co-authored-by: xiaoxintang <15707971810@163.com>
This commit is contained in:
Bartek Iwańczuk 2020-01-18 21:49:55 +01:00 committed by GitHub
parent 34b99fec8e
commit 23e67eb515
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 115 additions and 86 deletions

View file

@ -1307,8 +1307,8 @@ declare namespace Deno {
interface Addr {
transport: Transport;
/** UNSTABLE: Address is unstable because inconsistent with ConnectOptions. */
address: string;
hostname: string;
port: number;
}
/** UNSTABLE: Maybe remove ShutdownMode entirely. */
@ -1342,21 +1342,19 @@ declare namespace Deno {
*/
close(): void;
/** Return the address of the `Listener`. */
addr(): Addr;
addr: Addr;
[Symbol.asyncIterator](): AsyncIterator<Conn>;
}
export interface Conn extends Reader, Writer, Closer {
/** UNSTABLE: return Addr?
*
/**
* The local address of the connection.
*/
localAddr: string;
/** UNSTABLE: return Addr?
*
localAddr: Addr;
/**
* The remote address of the connection.
*/
remoteAddr: string;
remoteAddr: Addr;
/** The resource ID of the connection. */
rid: number;
/** Shuts down (`shutdown(2)`) the reading side of the TCP connection. Most
@ -1426,7 +1424,7 @@ declare namespace Deno {
}
/**
* Dial connects to the address on the named transport.
* Connects to the address on the named transport.
*
* @param options
* @param options.port The port to connect to. (Required.)