connect nodes that fail to respond to 3 ping requests (on the 4th attempt).
The default time is a ping every 3 mins, therefore a link will be struck out
after 12 minutes of nil response.
+2. Maintain a table of outstanding connects to other nodes and prevent over-
+laps (special favour to G0RDI).
17Nov99=======================================================================
1. Started using Data::Dumper for things again
2. 'Fixed' DXUser file corruption?
return (1, $self->msg('e5')) if $self->priv < 5;
return (1, $self->msg('e6')) unless $call gt ' ';
return (1, $self->msg('already', $call)) if DXChannel->get($call);
+return (1, $self->msg('outconn', $call)) if grep {$_->{call} eq $call} @main::outstanding_connects;
return (1, $self->msg('conscript', $lccall)) unless -e "$main::root/connect/$lccall";
my $prog = "$main::root/local/client.pl";
exec $prog, $call, 'connect';
} else {
sleep(1); # do a coordination
+ push @main::outstanding_connects, {call => $call, pid => $pid};
return(1, $self->msg('constart', $call));
}
}
my $dxchan = DXChannel->get($call);
if ($dxchan) {
if ($dxchan->is_ak1a) {
- $dxchan->send_now("D", DXProt::pc39($main::mycall, $self->msg('disc1', $self->call)));
+# $dxchan->send_now("D", DXProt::pc39($main::mycall, $self->msg('disc1', $self->call)));
} else {
return (1, $self->msg('e5')) if $self->priv < 8;
$dxchan->send_now('D', $self->msg('disc1', $self->call));
my $call = uc shift;
my $lccall = lc $call;
+ if (grep {$_->{call} eq $call} @main::outstanding_connects) {
+ dbg('cron', "Connect not started, outstanding connect to $call");
+ return;
+ }
+
my $prog = "$main::root/local/client.pl";
$prog = "$main::root/perl/client.pl" if ! -e $prog;
if (!$self->{outbound}) {
$self->send(pc38()) if DXNode->get_all();
$self->send(pc18());
+ # remove from outstanding connects queue
+ @main::outstanding_connects = grep {$_->{call} ne $call} @main::outstanding_connects;
}
$self->state('init');
$self->pc50_t(time);
nodec => '$_[0] created as AK1A style Node',
nodee1 => 'You cannot use this command whilst your target ($_[0]) is on-line',
ok => 'Operation successful',
+ outconn => 'Outstanding connect to $_[0]',
page => 'Press Enter to continue, A to abort ($_[0] lines) >',
pagelth => 'Page Length is now $_[0]',
passerr => 'Please use: SET/PASS <password> <callsign>',
$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
{
$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