Android > Web Socket > How to check socket connection state?
$10-30 USD
Completed
Posted over 8 years ago
$10-30 USD
Paid on delivery
I'm stuck with a small issue and need help - $20
Workflow of my application is like this:
Check row count in SQLite database -
If row count = 0, then
check if WebSocket = open
if yes, close socket connection
if no, do nothing
else
check if WebSocket = open
if yes, do nothing
if no, open socket connection
I'm struggling with finding Socket's current state -- check if WebSocket = open
I'm using the following library:
[login to view URL]
Any suggestion on how to solve this is appreciated.
Thanks!
onConnect();
Just save state on function : onConnect() in your class Listener , this is function call when socket connected, and when socket disconnect you can save state at function : disconnect() . :) Hope you can solve that problem.