> When I want to terminate the thread normally or when I force it to > terminate I call the THttpCli.Abort method. How can I insure that the > THttpCli component is indeed aborted before freeing it and ending the > thread? > > Right now I do: > HTTP.Abort; > while HTTP.State<>httpReady do > Sleep(10); > > Is this incorrect, unecessary or adequate?
It is totally incorrect. Such a loop will prevent any event from occuring and the state of the component will not change since it is blocked. If you want to use a wait loop (you should use events instead), then you /must/ call your message pump. If you use TWSocket own message loop, then call your twsocket instance ProcessMessages method. And do not use HTTP.State to end the loop but a flag you set in OnRequestDone event. To break TWSocket message loop, you can post WM_QUIT message. Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] Author of ICS (Internet Component Suite, freeware) Author of MidWare (Multi-tier framework, freeware) http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://www.elists.org/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be