Jul 18, 2011 at 11:25 PM
Edited Jul 18, 2011 at 11:26 PM
I wanted to create an application that is able to reconnect to an IMAP server automatically after it has been disconnected (probably accidentically).
In short something like that:
Imap4Client client = new Imap4Client();
// do something.... (accidentically disconnect)
// do something
And here is the problem, after calling "client.Disconnect()" the TCP Socket gets disposed and is not available anymore.
Therefore I get an "object disposed" exception when I try to call "client.Connect()" again after I disconnected.
The only way to solve that is to create a new Imap4Client object. But this is not suitable for me, since I derivated my class from the Imap4Client class it is not
possible for me to use "new" to create a new object. The derivated class should be able to reconnect on its own, by probably creating a new Socket object internally.
Thank you for you answers and ideas.