14 lines
338 B
Kotlin
14 lines
338 B
Kotlin
import kotlinx.coroutines.GlobalScope
|
|
import kotlinx.coroutines.delay
|
|
import kotlinx.coroutines.launch
|
|
import kotlinx.coroutines.runBlocking
|
|
|
|
fun main() = runBlocking{
|
|
GlobalScope.launch {
|
|
val mqtt = MqttSubscriber()
|
|
mqtt.connect()
|
|
delay(10000L)
|
|
mqtt.disconnect()
|
|
}
|
|
delay(20000L)
|
|
} |