akis has asked for the wisdom of the Perl Monks concerning the following question:
I am writing a long running perl script that connects to a NNTP server and fetches some articles, decodes the binaries, then fetch some more articles. Everything works fine, but sometimes the NNTP server disconnects me because the decode process takes too long. I want to have a way to test whether the connection is still there or have I timed out.
There needs to be a method that will return true if we are still connnected, and false otherwise. Much like DBI's ping method to test if we are still connected to the database. How would I go about doing this? Of course, there is the easy solution; just re-connect everytime I need to fetch articles. I would like your thoughts.
Btw, I am using Net::NNTP, and I have poked around in the source to see if there's any undocumented methods I can call. But it's all very ugly and I have not found anything that helps.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::NNTP ping?
by rob_au (Abbot) on Dec 30, 2003 at 08:39 UTC | |
by akis (Novice) on Dec 30, 2003 at 10:17 UTC | |
by rob_au (Abbot) on Dec 30, 2003 at 10:30 UTC | |
|
Re: Net::NNTP ping?
by robobunny (Friar) on Dec 30, 2003 at 16:15 UTC | |
by akis (Novice) on Dec 31, 2003 at 10:56 UTC | |
by robobunny (Friar) on Jan 02, 2004 at 14:27 UTC |