I create a new standalone web app, create a HandleURL event handler, then add this code:
Press run then close the webpage immediately.
I have waited about 10 minutes and the HTTP thread is still there when I pause the app.
This doesn’t happen when I leave the webpage open.
Is there a way to manually kill it after I call return?
I played around a little bit and I found a hack to get it to work:
Function HandleURL(Request As WebRequest) As Boolean
xojo.Core.Timer.CallLater(5000, AddressOf KillThread, App.CurrentThread)
Sub KillThread(A as Auto)
dim T as Thread = A
It looks like it works, (5000 is the timeout for lost connections) I’m just wondering if there’s a better way.
Also, I think this could go horribly wrong if it finds the main thread for some reason.