. But it looks working fine with Http ?
Here is the error i am getting Kotlin multiplatform: JobCancellationException: Parent job is Completed
a
Aleksei Tirman [JB]
01/25/2022, 8:39 AM
Could you please share a code snippet to reproduce your problem?
b
brabo-hi
01/25/2022, 5:31 PM
Copy code
class 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
brabo-hi
01/25/2022, 5:33 PM
Copy code
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