Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/node/net.ts>Socket#end

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
method Socket.prototype.end
import { Socket } from "https://deno.land/std@0.134.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