Delay then reconnect

Just starting out? Need help? Post your questions and find answers here.
itzybitzyspider
Posts: 27
Joined: Tue Nov 22, 2022 4:36 am

Delay then reconnect

Post by itzybitzyspider »

Hi, just like some advice.

I was playing around with the following

Code: Select all

 
If OpenWebSocket(2, "ws://127.0.0.1:8090" ) 
  Debug "Trying to open the websocket"
Else
  Debug "Web socket not supported."
  ;Wait 5 seconds then try OpenWebSocket() again
EndIf
I have a websocket in PB running. I can capture events such as disconnects but how do I then put a wait / delay then try again instead of trying again and again immediately?
AZJIO
Posts: 69
Joined: Wed Dec 14, 2022 1:13 pm

Re: Delay then reconnect

Post by AZJIO »

Code: Select all

AddWindowTimer(#Window, #Timer, Delay)
Post Reply