andyedinborough/aenetmail — pull request #12 by NadavK (2011-12-21 23:29:57+00:00)
Title: Fix for Idle

For me (Win7, 64 bit), calling thread.abort on a thread waiting on _Reader.ReadLine causes _Reader to disconnect.
This started (at least for me) when aenetmail moved to MS reader library.
I fixed this by changing *all* ReadLines to be async, via a blocking queue (even though its only needed for imap).
I further changed the imap Idle thread to automatically call IDLE every 20 minutes, and remain active for these calls.

NOTE: Noop() no longer injects ReadLine back into the queue.
I felt uncomfortable exposing queue.Add, and I'm not sure of the exact scenario, so I left it remarked.