use

suspend fun <R> use(block: suspend (TapConnection) -> R): R(source)

Runs block with this connection, then closes it. A block failure wins; a close failure after it is added as suppressed.