I am looking for any pointers for enabling me to write a non-blocking socket type of IMAP client. What does JavaMail do? Can that be used for this purpose? Will that be blocking the calls over the connection.. if yes, what could be the workaround for making it non-blocking? I'd like not to implement the IMAP client spec by myself, and reuse the one Sun provides with JavaMail. Any help will be greatly appreciated! thanks!
author and iconoclast
The java.nio package does have support for non-blocking I/O, but I'm not sure what the benefit of using this would be for IMAP, which is a request/response protocol. Perhaps what you're really interested in is having a GUI be responsive during the IMAP interaction? In that case, what you want to do is just spawn a separate Thread in which to do the communications.