0

I need to keep connection when my connectivity internet is off

Or in other word,i want to reconnect socket to server if it get fail

I connect to socket in service and if it can connect so i get stream and save message or get message successfully

But when wifi or data connection disconnect and again connected,socket lost conenction

Thanks

1 Answers1

0

Finally i use sticky service and use timer for check socket status each tick timer

And when socket is disconnected,try to make connection again

Note that if we conenct all time to socket,server maybe down

So i decide to use socket connection when i need to it and disconnect it after my app closed