By Guest on Monday, 23 May 2022
Posted in General
Replies 1
Likes 0
Views 1K
Votes 0
When watchdog is enabled, if there is a disconnection and the client tries to reconnect, the form is locked till connects or fails. Any solution?
Hello,

The WatchDog property tries to reconnect using blocking mode if NotifyEvents <> neNoSync or the connection has started using blocking mode.
You can override this behaviour using the event OnBeforeWatchDog. Do the following:


procedure OnBeforeWatchDog(Sender: TObject; var Handled: Boolean);
begin
TsgcWebSocketClient1.Start;
Handled := True;
end;


This event is called before the Watchdog is trying to reconnect. You can call here the async method "Start" to reconnect, and avoid the WatchDog automatically reconnect setting the parameter Handled := true, this means the reconnection is handled by you, not by the component.

Kind regards,
Sergio
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post