I'm working with 2019r3.1 and a compiled web service (no UI) on Linux (64-bit). Here's the code:
If shutdownRequest Then MessageAdd(CurrentMethodName + ": shutting down in 20 seconds.") // Breathing room for script completion & possible upload new exe Xojo.Core.Timer.CallLater(20000, AddressOf QuitApp) End If
The above is triggered in a timer (main thread) and works fine. Here's the QuitApp method:
This concept works most of the time, but not when the shutdownRequest is set after what appears to be a hanging thread because of an open HTTP socket.
What happens in that case is the "shutting down in 20 seconds" is being logged infinitely (timer works fine) but the QuitApp method is never logged / called.
Could it be that the hanging thread blocks CallLater somehow? Can I check that or is there a workaround?