Kotlin: Connection.awaitConnect()

DESCRIPTION

Open a connection as described for Connection.connect().

This function is meant to be used in a Kotlin coroutine to suspend execution until the connection is established or an error occurs.

DECLARATION

suspend fun Connection.awaitConnect() 

THROWS EXCEPTIONS

NabtoRuntimeException:
with error code STOPPED if the client instance was stopped
NabtoRuntimeException:
with error code NO_CHANNELS if a connection could not be established.