in reply to Timeout problem using IO::Socket
--Chrissub play_remote_file { my $file = shift; my $sock = new IO::Socket::INET (PeerAddr => 'jcwren', PeerPort => 10666, Proto => 'tcp', ); return unless $sock; print $sock $file, "\n"; $SIG{ALRM} = \&timed_out; eval { alarm (30); my $buf = <$sock>; alarm (0); }; close ($sock); } sub timed_out { die "GOT TIRED OF WAITING"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: (jcwren) Re: Timeout problem using IO::Socket
by ChOas (Curate) on Sep 27, 2000 at 15:51 UTC |