brabo-hi
01/25/2022, 1:37 AMHttpClient
with CIO
when using WebSockets
. But it looks working fine with Http ?
Here is the error i am getting Kotlin multiplatform: JobCancellationException: Parent job is CompletedAleksei Tirman [JB]
01/25/2022, 8:39 AMbrabo-hi
01/25/2022, 5:31 PMclass MyService {
private val client= HttpClient {
install(WebSockets)
}
fun openSocket() {}
fun closeSocket(code: Int, reason: String) {}
fun sendMessage(msg:String) {}
}
The issue was when using the same instance of MyService
val myService = MyService()
myService.sendMessage();
Here i want to reuse the same myService
instead of creating a new instance each time i want to start a new connection