Monday, 17 March 2025
  2 Replies
  18 Visits
  Subscribe
Hi,

I have a problem on destroying a TsgcWebSocketClient which has a WatchDog enabled.

It appears as if when the Client Active is set to false, then the Client destroyed, the WatchDog is still active & errors on "if GetWatchDog.Attempts > 0 then " in OnWatchDogEvent as no TsgcWSWatchDog_Options returned from GetWatchDog.

Is there a method to "Closedown" the Client pre-destoy?

I have attached a basic example, check "Server Active", then "Create ClientThreads", give it a minute then uncheck "Server Active". It will take a minute before the TClientThread breaks "NO HEARTBEAT" and should Client.Active = False then destroy the Client.

It's here that I receive the Access Violation. The problem is that the Access Violation doesn't appear to be caught. When run as a service I only see in Windows Event Viewer. The service locks up, I'm not sure if this is the issue?

It's possible that both the Heartbeat & Watchdog need to be Enabled for this to occur, still working through code.

Any thoughts?
Ryszard