diff options
author | crowlKats <crowlkats@gmail.com> | 2020-03-13 10:22:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-13 10:22:22 +0100 |
commit | e435c2be158ce8657dbff0664b6db222fe4e586c (patch) | |
tree | b0e72033be2ce51a70fd2c2af23e6da131a642bb /cli/js/net.ts | |
parent | 3ac642c183981a366e1db565c16b81f864b07ee4 (diff) |
Remove doc strings from cli/js TS files (#4329)
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
Diffstat (limited to 'cli/js/net.ts')
-rw-r--r-- | cli/js/net.ts | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/cli/js/net.ts b/cli/js/net.ts index 52c558339..570bada49 100644 --- a/cli/js/net.ts +++ b/cli/js/net.ts @@ -19,36 +19,23 @@ export interface UDPAddr { port: number; } -/** A socket is a generic transport listener for message-oriented protocols */ export interface UDPConn extends AsyncIterable<[Uint8Array, Addr]> { - /** Waits for and resolves to the next message to the `Socket`. */ receive(p?: Uint8Array): Promise<[Uint8Array, Addr]>; - /** Sends a message to the target. */ send(p: Uint8Array, addr: UDPAddr): Promise<void>; - /** Close closes the socket. Any pending message promises will be rejected - * with errors. - */ close(): void; - /** Return the address of the `Socket`. */ addr: Addr; [Symbol.asyncIterator](): AsyncIterator<[Uint8Array, Addr]>; } -/** A Listener is a generic transport listener for stream-oriented protocols. */ export interface Listener extends AsyncIterable<Conn> { - /** Waits for and resolves to the next connection to the `Listener`. */ accept(): Promise<Conn>; - /** Close closes the listener. Any pending accept promises will be rejected - * with errors. - */ close(): void; - /** Return the address of the `Listener`. */ addr: Addr; [Symbol.asyncIterator](): AsyncIterator<Conn>; @@ -73,16 +60,10 @@ export class ConnImpl implements Conn { close(this.rid); } - /** closeRead shuts down (shutdown(2)) the reading side of the TCP connection. - * Most callers should just use close(). - */ closeRead(): void { netOps.shutdown(this.rid, netOps.ShutdownMode.Read); } - /** closeWrite shuts down (shutdown(2)) the writing side of the TCP - * connection. Most callers should just use close(). - */ closeWrite(): void { netOps.shutdown(this.rid, netOps.ShutdownMode.Write); } @@ -162,19 +143,10 @@ export class UDPConnImpl implements UDPConn { } export interface Conn extends Reader, Writer, Closer { - /** The local address of the connection. */ localAddr: Addr; - /** The remote address of the connection. */ remoteAddr: Addr; - /** 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()`. - */ closeRead(): void; - /** Shuts down (`shutdown(2)`) the writing side of the TCP connection. Most - * callers should just use `close()`. - */ closeWrite(): void; } @@ -184,23 +156,6 @@ export interface ListenOptions { transport?: Transport; } -/** Listen announces on the local transport address. - * - * @param options - * @param options.port The port to connect to. (Required.) - * @param options.hostname A literal IP address or host name that can be - * resolved to an IP address. If not specified, defaults to 0.0.0.0 - * @param options.transport Must be "tcp" or "udp". Defaults to "tcp". Later we plan to add "tcp4", - * "tcp6", "udp4", "udp6", "ip", "ip4", "ip6", "unix", "unixgram" and - * "unixpacket". - * - * Examples: - * - * listen({ port: 80 }) - * listen({ hostname: "192.0.2.1", port: 80 }) - * listen({ hostname: "[2001:db8::1]", port: 80 }); - * listen({ hostname: "golang.org", port: 80, transport: "tcp" }) - */ export function listen( options: ListenOptions & { transport?: "tcp" } ): Listener; @@ -225,23 +180,6 @@ export interface ConnectOptions { transport?: Transport; } -/** Connects to the address on the named transport. - * - * @param options - * @param options.port The port to connect to. (Required.) - * @param options.hostname A literal IP address or host name that can be - * resolved to an IP address. If not specified, defaults to 127.0.0.1 - * @param options.transport Must be "tcp" or "udp". Defaults to "tcp". Later we plan to add "tcp4", - * "tcp6", "udp4", "udp6", "ip", "ip4", "ip6", "unix", "unixgram" and - * "unixpacket". - * - * Examples: - * - * connect({ port: 80 }) - * connect({ hostname: "192.0.2.1", port: 80 }) - * connect({ hostname: "[2001:db8::1]", port: 80 }); - * connect({ hostname: "golang.org", port: 80, transport: "tcp" }) - */ export async function connect({ port, hostname = "127.0.0.1", |