Re: [twsocket] How to use many TSmtpCli's inside thread ?

2009-08-19 Thread Arno Garrels
Max Terentiev wrote: Use TSslSmtpCli and call the async methods. Your threads must also implement a message pump or simply call the ICS, built-in, message pump instead (TSslSmtpCli.CtrlSocket.MessageLoop). But how to implement message pump if I create many TSmtpCli inside TThread ? Unlike

Re: [twsocket] How to use many TSmtpCli's inside thread ?

2009-08-19 Thread Arno Garrels
Arno Garrels wrote: **ALWAYS** create and destroy them in Execute method That is not always necessary, however ensures that they are always created in the context of the thread. Note that ICS event handlers are by default called in the context of the thread the object was created in. --

Re: [twsocket] How to use many TSmtpCli's inside thread ?

2009-08-18 Thread Arno Garrels
Max Terentiev wrote: Hi, Hi, It's possible to use multiple TSmtpCli inside single TThread ? Yes. For example, I want to handle 100 connections using 5 TThreads. Each TThread should contain 20 TStmpCli's. Is it's possible ? No problem, however you should consider to use just as many

Re: [twsocket] How to use many TSmtpCli's inside thread ?

2009-08-18 Thread Max Terentiev
Use TSslSmtpCli and call the async methods. Your threads must also implement a message pump or simply call the ICS, built-in, message pump instead (TSslSmtpCli.CtrlSocket.MessageLoop). But how to implement message pump if I create many TSmtpCli inside TThread ? I must implement loop like