I create a new standalone web app, create a HandleURL event handler, then add this code:
DoEvents(10000)
Return true
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?
Thanks,
Alex
I played around a little bit and I found a hack to get it to work:
HandleURL Event:
Function HandleURL(Request As WebRequest) As Boolean
DoEvents(10000)
xojo.Core.Timer.CallLater(5000, AddressOf KillThread, App.CurrentThread)
Return True
end if
End Function
App.KillThread Method:
Sub KillThread(A as Auto)
dim T as Thread = A
T.Kill
End Sub
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.
Thoughts?