Commit a031034f authored by Philipp Auersperg's avatar Philipp Auersperg

...

parent 77bcb975
......@@ -6,6 +6,7 @@ import co.gongzh.procbridge.ProcBridgeException
import com.google.gson.JsonObject
import kotlinx.coroutines.*
object ProcbridgeClient {
lateinit var pb:ProcBridge
......@@ -29,6 +30,7 @@ object ProcbridgeClient {
fun request(api:String, params:String): JsonObject {
println("request before:$api")
val res = runBlocking (Dispatchers.IO){
// this must run in the IO Threadpool, otherwise a NetworkInMainThreadException pops up
pb.sendMessage(api, "{$params}")
}
println("request after:$res")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment