smeenz has asked for the wisdom of the Perl Monks concerning the following question:
I'm finding that as of a week ago, I'm intermittantly getting my TCP connection reset by one particular host half way through the command output (I receive approx 120K of output before the RST is sent).
I'm not sure why the connection is being reset, but it would be sufficient if I can detect this situation and attempt to reconnect.
The problem though is that I can't figure out how to tell if the connection is closed or not. In the case of a closed connection, the handle is still valid (as there could be buffered unreaed input waiting), so I can't test on that. Using $t->eof(), I can tell if there is output pending, but I can't spot anything that will tell me if the connection is still valid or not, other than by testing a write and seeing if it suceeds, which seems a bit kludgy to me.
Is there something I'm missing, or do I have to test for a successful write ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::Telnet - how to detect a reset connection ?
by markh (Scribe) on Dec 12, 2006 at 23:39 UTC | |
|
Re: Net::Telnet - how to detect a reset connection ?
by traveler (Parson) on Dec 12, 2006 at 22:24 UTC | |
by smeenz (Sexton) on Dec 12, 2006 at 22:54 UTC | |
|
Re: Net::Telnet - how to detect a reset connection ?
by vladdrak (Monk) on Dec 13, 2006 at 08:35 UTC |