Module

std/node/net.ts>Socket#end

Deno standard library
Go to Latest
method Socket.prototype.end
import { Socket } from "https://dotland.deno.dev/std@0.116.0/node/net.ts";

Half-closes the socket. i.e., it sends a FIN packet. It is possible the server will still send some data.

See writable.end() for further details.

Parameters

optional
cb: () => void

Only used when data is string.

Returns

this

The socket itself.

Parameters

buffer: Uint8Array | string
optional
cb: () => void

Parameters

data: Uint8Array | string
optional
encoding: Encodings
optional
cb: () => void

Parameters

optional
data: Uint8Array | string | (() => void)
optional
encoding: Encodings | (() => void)
optional
cb: () => void