Author |
|
litmusjustin Newbie
Joined: 15 March 2013
Online Status: Offline Posts: 4
|
Posted: 25 March 2013 at 9:43am | IP Logged
|
|
|
Since IMAP can sometimes stall out and stop receiving messages from the server, I am trying to refresh (disconnect and reconnect) the IMAP connection on an interval. When I execute the following code:
if (imap != null && imap.IsConnected)
{
imap.Disconnect();
}
I find that I get an exception with the text "There is
already an operation in progress." Is there a way to force the disconnect since even if the connection stopped receiving messages from the IMAP server it still seems to have "an operation in progress"? I am checking elsewhere in the code to make sure we don't have an actual operation in progress.
|
Back to Top |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 26 March 2013 at 1:46am | IP Logged
|
|
|
In this case, you should call .Abort instead of .Disconnect. Abort method can be called while there is an operation in progress.
Regards,
Alex
|
Back to Top |
|
|