# (2) Converted checks to new plugin mechanism (Stephen Johnson May 28, 1999)
# Added user-configurable escalation mechanism
#
-# $Id: spong-network.pl,v 1.34 2001/04/17 02:58:12 sljohnson Exp $
+# $Id: spong-network.pl,v 1.35 2001/05/07 19:19:24 sljohnson Exp $
use Carp;
use lib "@@LIBDIR@@";
select((select(SOCK), $| = 1)[0]);
print SOCK "$data";
recv( SOCK, $line, 256, 0 ); # just grab a chunk from the service.
- close( SOCK ) || die "close: $!";
+ alarm(0);
+ close( SOCK ) || die "close: $!";
};
- alarm(0);
- close( SOCK ) || die "close: $!"; # close even if our alarm went off
if ( $@ =~ /^(.*) at/ ) { $err = $1; }
if ( $@ =~ /timed out/ ) { $err = "check_tcp timed out"; }