|
I'm trying to use the IMAP IDLE feature to detect new mail. When a new mail is detected, the IDLE should stop and I will download the new mail. However, when I call EndCheckForUpdates from the Notification event handler, it's just hanging. See example code below: The class have these members:
The client is properly connected to the server, and the inbox is selected. Then I do:
This method is being called when a new mail arrives:
The problem is that the EndCheckForUpdates method call doesn't finish. How do I solve this? I want to cancel the IDLE as soon as I get a mail notification. |
|
Please note the In your case you made a deadlock. EndCheckForUpdates cannot finish, because it is waiting for the The correct usage is as follows:
|