I'm making my first foray into the world of IO::Sockets, and, for the most part, it seems fairly straightforward. The one thing I'm having a bit of trouble with, however, is a test for whether a connection is actually /live/.
A bit of background:
As a pet project, I'm working on a website content aggregator - a very simple thing. Essentially, it's a piece of server code that sits and waits for a query from a simple cgi script, then, in turn, goes out and uses TCP to acquire data from other sites - a 'bot. Fairly simple.
I'm trying to trap the case of 'what happens when that connection is broken, and I need to reconnect before I can actually return data'. Is there a simple test for connectivity I can implement to see if a connection's idled out or otherwise gone stale?
A server reboot, for instance, on the far end, leaves me with a dead connection and no indication that it's dropped.
What's the usual way of monitoring this sort of thing? Grimm
In reply to An IO::Sockets 'test for live connection' question: by jonahgrimm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |