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
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
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
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!!