Patrick Wong wrote: > Thank you for your response. > >> Or use the messageLoop of TWSocket if you dont need to receive custom >> messages. Set Multithreaded to true. > > But may I know how? I am not quite familiar with Delphi.
Writing/using message loops is not specific to Delphi but to Windows applications. Wilfried ment that you may use method Pop3Cli.CtrlSocket.Messageloop instead of writing your own message pump. > From the > Pop3prot.hpp MultiThreaded is a protected bool of TSyncPop3Cli >, which > is inherited from TPop3Cli. Should I use TSyncPop3Cli instead? No, better run async even in a worker thread. > >> From Arno's previous message, > >> 1 - Create the Pop3Cli instance in Execute >> 2 - Assign properties and events >> 3 - Connect >> 4 - Start your MessageLoop > > It would be great if a sample code excerpt that you can kindly show > me. Should the worker thread call connect once, and other functions > in every mail retrieval cycle? My thought was to connect -> get > mails -> delete mails ->quit in every cycle. There's no difference between running the component in main thread or in a worker thread given you process messages by some kind of message loop. Delphi's class TThread does not implement such a message loop by default . Think asynchrone, call Connect and the take any further action in the various event handlers. --- Arno Garrels [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html > > > >> -- >> 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
-- 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