end

open override fun end(cb: () -> Unit)(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

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

callback

Optional callback for when the socket is finished.


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