I used closeBlocking() to close the websocket, it works correct on activity. Now i move these code to back service, then it will block about 7 minutes on closeBlocking().
Sure, i can close it without bolcking, such as close(), or close it in another thread. But it just release the thread, the websocket still be blocked, it cann't be used before it closed ( It will not work even new another websocket).
my code like this:
clientSocket = new JWebSocketClient(uri, httpHeaders){...}; clientSocket.setConnectionLostTimeout(220); clientSocket.connectBlocking(2, TimeUnit.MINUTES);
and close it like this:
clientSocket.closeBlocking();
I used closeBlocking() to close the websocket, it works correct on activity. Now i move these code to back service, then it will block about 7 minutes on closeBlocking().
Sure, i can close it without bolcking, such as close(), or close it in another thread. But it just release the thread, the websocket still be blocked, it cann't be used before it closed ( It will not work even new another websocket).
my code like this:
clientSocket = new JWebSocketClient(uri, httpHeaders){...}; clientSocket.setConnectionLostTimeout(220); clientSocket.connectBlocking(2, TimeUnit.MINUTES);
and close it like this:
clientSocket.closeBlocking();
What is the problem, if there are solve solution?