close

abstract suspend fun close(code: Int? = null, reason: String? = null)

Closes the socket with an optional code and reason.