close

fun close(code: Short = definedExternally, reason: String = definedExternally)(source)

The WebSocket.close() method closes the already CLOSED, this method does nothing.

MDN Reference