want to set timeout for POP3 connection task
Hello,
I have used Java Mail's POP3 protocol to read incoming email & delete it.
Java Mail works fine. But problem is, some times (most probably for connection failure) when I call store.connect(host, username, password);
code gets stuck at this line. And neither goes to next line nor gives any exception.
Is there any way to set timeout (TTL) for store.connect() ?
Here goes some of my code
Properties props =new Properties();
// Get session
Session session = Session.getDefaultInstance(props,null);
// Get the store
store = session.getStore("pop3");
log.debug("Connecting");
store.connect(host, username, password);
log.debug("Connected");
// Get folder
folder = store.getFolder(mailFolder);
folder.open(Folder.READ_WRITE);
( I have got "Connecting" (from log.debug) but can't get "Connected" :( )
Can any one help me please?
Thanks
Regards
-Nahid

