Hello, in my ABMaterial application in each of my server websocket classes I have a 'heartbeat' timer.
All I do in the timer is send a js command and expect a correct answer. I am using this timer to hurry up the disconnect event in case the connection is left hanging. I initialize the timer in the Initialize sub, enable the timer in the Connected sub and disable the timer in the Disconnected sub.
Can I safely replace this timer with resumable sub using Sleep ?
I will do something like:
And in Connected sub I will call the StartHeartBeat.
All I do in the timer is send a js command and expect a correct answer. I am using this timer to hurry up the disconnect event in case the connection is left hanging. I initialize the timer in the Initialize sub, enable the timer in the Connected sub and disable the timer in the Disconnected sub.
Can I safely replace this timer with resumable sub using Sleep ?
I will do something like:
B4X:
Sub StartHeartBeat()
Do While ws.Open
Sleep (5000)
VerifyIfBrowserIsAlive
Loop
End Sub