πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #8562

MAIL: How to handle a POP server time-out?

#8562
From: Torch
Date: Wed, 14 Mar 2001 09:56
44 lines
2212 bytes
Hello again, 

Since I still have the same problem as I addressed here before, I'll
try/dare asking again. In the meanwhile I've found a workaround but
this workaround is not that charming. Above all I find that a descent
API should offer some support in handling time outs! 

My problem concerns reading large messages from a POP3 server. After
processing the message, the POP3 server has (probably) timed out (I
get the debug info: 'S:-ERR POP timeout' when reading the next email
from the server). No exception occurs when deleting the previous
message en reading the next (folder.getMessage(i)). When accessing the
message just read from the server (.getSubject()) an exception occurs
(error fetching POP3 content). 

How can I detect a timeout has occured (I tried adding
ConnectionListeners)? And how can I reconnect? 

I've tried to demonstrate this with the example below. Reading the
second email from the queue causes the exception! 

try{ 
  Iterator iterMail = new SsvReceiveMail(); 

  while(iterMail.hasNext()) { 
    System.out.println("Read Mail");
    // Error occurs when reading 2nd mail

    SsvMail csvMail = (SsvMail)iterMail.next(); 

     // wait 10 minutes...causing Time Out) 
    Thread.sleep(1000*60*10);

    System.out.println("Delete Mail"); 
    iterMail.remove(); 

    System.out.println("Delete Mail done"); 
  } 
  System.out.println("Complete"); 
} catch(Exception e) { 
  e.printStackTrace(); 
} 

regards RenοΏ½ 
Technical Details
Message-ID: <3aaf3f4d.327270@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!dnews!212.185.40.194

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f74b3,7f0d4f5f1114ca50,start
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-03-14 02:06:07 PST
From: r.hees@windsoft.de (Torch)
Newsgroups: borland.public.jbuilder.java.language
Subject: MAIL: How to handle a POP server time-out?
Date: Wed, 14 Mar 2001 09:56:32 GMT
Message-ID: <3aaf3f4d.327270@newsgroups.borland.com>
X-Newsreader: Forte Free Agent 1.21/32.243
NNTP-Posting-Host: 212.185.40.194
X-Trace: 14 Mar 2001 01:55:48 -0800, 212.185.40.194
Lines: 45
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!dnews!212.185.40.194