Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET IMAP

 AfterLogic Forum : MailBee.NET IMAP
Subject Topic: Operation in progress error on disconnect Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
litmusjustin
Newbie
Newbie


Joined: 15 March 2013
Online Status: Offline
Posts: 4
Posted: 25 March 2013 at 9:43am | IP Logged Quote litmusjustin

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 View litmusjustin's Profile Search for other posts by litmusjustin
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 26 March 2013 at 1:46am | IP Logged Quote Alex

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 View Alex's Profile Search for other posts by Alex
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide