in reply to
Catch loss of communication
If
select
doesn't help, you could periodically "ping" the connection by issuing a command that does nothing.
Comment on
Re: Catch loss of communication
Download
Code
In Section
Seekers of Perl Wisdom