Michael Kochendoerfer wrote:
> calls .Connect. I can see in a log that OnRequestDone is fired
> multiple times until it gets smtpQuit. When calling the next time,
> I'll get the above exception.

When the response to the Quit command is received the connection
(may) still be alive. So watch both, whether Quit response has been
received as well as the SessionClose event. Call connect only
after the session has been closed.
Don't start a loop directly from an event handler but post a custom
message to some Window, in it's message handler start the next loop.

BTW: The mail server is responsible to close the connection after
he has sent out the OK-reply to the Quit request, however it should
not hurt when a client closes the connection after receiving the
Quit-response.

BTW-2: Do not forget to implement your own timeout mechanism.  

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

Reply via email to