Monday, 23 May 2022
  1 Replies
  650 Visits
  Subscribe
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?
1 year ago
·
#1065
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
  • Page :
  • 1
There are no replies made for this post yet.
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below.
Supported: gif,jpg,png,jpeg,zip,rar,pdf
· Insert · Remove
  Upload Files (Maximum 10MB)