Max Terentiev wrote:
> Hi,

> It's possible to use multiple TSmtpCli inside single TThread ?

> 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 
threads as CPUs are available. It's no problem to have 100 ICS 
objects and more in a single thread.
> I must use T(ssl)SmtpCli or TSYNCSmtpCli ?

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). 
You also have to instanciate a TSslStaticLock object in a 
multi-threaded environment to make the OpenSSL libraries thread-safe. 
Read comments in unit OverbyteIcsThrdLock.pas for more details.
Also TSslContext should be thread-safe so it's not required to use 
one context object per TSslSmtpCli instance.

Arno Garrels
To unsubscribe or change your settings for TWSocket mailing list
please goto
Visit our website at

Reply via email to