$version = "1.35"; # the version no of the software
$starttime = 0; # the starting time of the cluster
$lockfn = "cluster.lock"; # lock file name
+@outstanding_connects = (); # list of outstanding connects
# handle disconnections
sub disconnect
my $dxchan = DXChannel->get_by_cnum($conn); # get the dxconnnect object for this message
if (defined $err && $err) {
- disconnect($dxchan) if defined $dxchan;
+ if ($dxchan) {
+ disconnect($dxchan);
+ }
return;
}
{
$SIG{'CHLD'} = \&reap;
my $cpid = wait;
+ @outstanding_connects = grep {$_->{pid} != $cpid} @outstanding_connects;
}
# this is where the input queue is dealt with and things are dispatched off to other parts of
$dxchan->normal($line);
disconnect($dxchan) if ($dxchan->{state} eq 'bye');
} elsif ($sort eq 'Z') {
+ $dxchan->conn(undef);
disconnect($dxchan);
} elsif ($sort eq 'D') {
; # ignored (an echo)