[twsocket] Same question abot SmtpCli (proper way to abort)

2009-10-12 Thread Max Terentiev
Hi, What is proper way to abort Smtp connection in case of timeout ? SmtpCli.CtrlSocket.Close or CloseDelayed ? I ask because I notice strange problem with OnRequestDone event: Some times after calling SmtpCli-Abort and attempting to establish new connection I receive OnRequestDone for

Re: [twsocket] Same question abot SmtpCli (proper way to abort)

2009-10-12 Thread Arno Garrels
Max Terentiev wrote: What is proper way to abort Smtp connection in case of timeout ? SmtpCli.CtrlSocket.Close or CloseDelayed ? Abort is fine. I ask because I notice strange problem with OnRequestDone event: Some times after calling SmtpCli-Abort and attempting to establish new

Re: [twsocket] Same question abot SmtpCli (proper way to abort)

2009-10-12 Thread Max Terentiev
Do not reconnect directly from an event handler, but post a custom window message and from the message handler set properties as needed and reconnect. But if I understand correctly CloseDelayed already use PostMessage and window handler to terminate connection. So, if I will use CloseDelayed

Re: [twsocket] Same question abot SmtpCli (proper way to abort)

2009-10-12 Thread Fastream Technologies
The same problem happens with THttpCli as well. It simply calls OnRequestDone twice under some conditions. To prevent this, I have had to override the component SetReady() method. Otherwise, if you postmessage from the first call, the second one could still arrive later than the posted message!!