--- projects/cms/source/host/ihost-perl/ihost.pl 2001/03/20 12:58:22 1.33 +++ projects/cms/source/host/ihost-perl/ihost.pl 2001/03/22 08:53:59 1.34 @@ -10,7 +10,7 @@ # - pjm2@ukc.ac.uk # # $Author: pjm2 $ -# $Id: ihost.pl,v 1.33 2001/03/20 12:58:22 pjm2 Exp $ +# $Id: ihost.pl,v 1.34 2001/03/22 08:53:59 pjm2 Exp $ #------------------------------------------------------------ $| = 1; @@ -361,9 +361,13 @@ EOF # send_tcp_heartbeat # Establishes a TCP connection to an i-scream filter. # The heartbeat is used as a guaranteed "I'm alive" delivery mechanism. +# If we need to reconfigure, then we complete the heartbeat before +# doing so. #----------------------------------------------------------------------- sub send_tcp_heartbeat() { + my ($doReconfigure) = 0; + my($sock) = new IO::Socket::INET( PeerAddr => $filter_addr, PeerPort => $tcp_port, @@ -410,8 +414,7 @@ sub send_tcp_heartbeat() { if ($response eq "ERROR\n") { close($sock); print "Server configuration changed. Reconfiguring with filter manager.\n"; - &tcp_configure(); - return; + $doReconfigure = 1; } if (!$response eq "OK\n") { close($sock); @@ -431,6 +434,8 @@ sub send_tcp_heartbeat() { close($sock); print "^"; + + &tcp_configure() if $doReconfigure; return; }