Hello everyone, What is the correct way to check i...
# kotlinx-rpc
a
Hello everyone, What is the correct way to check if a krpc client is still connected?
same 1
n
I am not sure if it is the correct way, or even if a correct way exists, but for tests, I am using:
Copy code
val rpc = client.rpc(RpcEndpoints.MAIN)
        rpc.webSocketSession.await()
        rpc.awaitCompletion()
a
Perhaps I should rephrase my question. I tend to reuse a krpc client I create. So, I would create a particular client like so
Copy code
val rpc = client.rpc("/service)
And the use it normally. Say,
Copy code
val users = rpc.withService<UsersService>()
After I have made a few rpc calls, I need to check if my client is still active/connected. This is so that, I may recreate a new rpc connection if the first one is disconnected. The solution you provided would require me to create another rpc client and check if that one is connected and that is not what I am currently looking for!