disconnect

abstract suspend fun disconnect()(source)

If graceful disconnect is enabled (which is the default), sends a DISCONNECT frame to close the session, waits for the relevant RECEIPT frame, and then closes the connection. Otherwise, force-closes the connection.

If a RECEIPT frame is not received within the configured time, it may be because the server closed the connection too quickly to send a RECEIPT frame, which is not considered an error. That's why this function doesn't throw an exception in this case, it just returns normally.