S22.Imap icon indicating copy to clipboard operation
S22.Imap copied to clipboard

Underlying connection reset

Open vchernyshev opened this issue 12 years ago • 4 comments

If underlying connection was reset (IP address changed) lib stops from being responding. It is sitting quiet without firing new message events (actually new emails keep arrivning into mailbox). And I have no way to control it from my app side.. Any workarounds on it?

Thanks,

vchernyshev avatar Nov 18 '13 21:11 vchernyshev

Well if the connection is reset, obviously the TCP connection to the IMAP server will get reset as well. The library does not automatically attempt to silently re-connect.

The .NET framework offers a NetworkAvailabilityChanged event that is raised when the availability of the network changes. You could subscribe to that and try to re-connect to the server whenever it's raised and the 'IsAvailable' property is true.

smiley22 avatar Nov 21 '13 10:11 smiley22

This sounds similar as to #51 But without exception. There is no exception raised at all when this happens?

NiKiZe avatar Nov 24 '13 02:11 NiKiZe

This is a fun problem to solve... you can see how I did it in my C library here:

https://github.com/jstedfast/spruce/blob/master/spruce/providers/imap/spruce-imap-engine.c#L1368

jstedfast avatar Jan 10 '14 23:01 jstedfast

@vchernyshev the ImapClient class now exposes the IdleError event to which you can subscribe in order to be notified when the underlying connection is reset.

smiley22 avatar Jan 21 '14 22:01 smiley22