end

open external override fun end(cb: () -> Unit = definedExternally)(source)

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.

Since

v0.1.90

Return

The socket itself.

Parameters

callback

Optional callback for when the socket is finished.


open external override fun end(data: Uint8Array<*>, cb: () -> Unit = definedExternally)(source)
open external override fun end(data: String, cb: () -> Unit = definedExternally)(source)

Half-closes the socket, with one final chunk of data.

Since

v0.1.90

Return

The socket itself.

Parameters

callback

Optional callback for when the socket is finished.

See also

{@link Socket.end} for full details.


external fun end(str: Uint8Array<*>, encoding: BufferEncoding = definedExternally, cb: () -> Unit = definedExternally)(source)
open external override fun end(str: String, encoding: BufferEncoding = definedExternally, cb: () -> Unit = definedExternally)(source)

Half-closes the socket, with one final chunk of data.

Since

v0.1.90

Return

The socket itself.

Parameters

encoding='utf8' Only used when data is string.

callback

Optional callback for when the socket is finished.

See also

{@link Socket.end} for full details.