Android Question Reconnenct socket

devmobile

Active Member
Licensed User
Hello
I connect to server with socket in my project
I dont have any problem until my connection lost.
When i lost connection(wifi or data),aslo socket lost
Now how i keep connection after i connect to wifi or data?
 
Last edited:

devmobile

Active Member
Licensed User
You should try to connect again. Initialize Socket and call the connect code again.

You can use Sleep is a loop to try to reconnect every 10 seconds until successful.
Your means is :

B4X:
Do While True
reconnect socket
sleep(5000)
Loop

Is that right?
 
Upvote 0
Top