How can I interrupt IMAP's IDLE?

前端 未结 3 803
慢半拍i
慢半拍i 2021-01-12 13:44

I am using the Javamail API connecting to my IMAP server. Everything is working great with the javax.mail.Folder.idle() method. My listener gets called when a new mail comes

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-12 14:25

    Performing any operation on that folder (from another thread) will cause idle() method to return immediately. So if you want to forcefully interrupt it, just call close() from a new thread.

提交回复
热议问题