X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXProt.pm;h=b8d563979b762f12e7e0ebf7db3ed37560a956aa;hb=d49641602b7abfa832d6baaf18dc15969040083e;hp=67f64b79064616092577d3cbabab6629a26cc7ca;hpb=f534cd884051603e9f0368b912afa355e7a2310f;p=spider.git diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 67f64b79..b8d56397 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -126,17 +126,23 @@ sub start $self->send_now('B',"0"); $self->send_now('E',"0"); + # ping neighbour node stuff + $self->pingint($user->pingint || 3*60); + $self->nopings(3); + $self->pingtime([ ]); + # send initialisation string - if (!$self->{outbound}) { + unless ($self->{outbound}) { $self->send(pc38()) if DXNode->get_all(); $self->send(pc18()); + $self->lastping($main::systime); + } else { + # remove from outstanding connects queue + @main::outstanding_connects = grep {$_->{call} ne $call} @main::outstanding_connects; + $self->lastping($main::systime + $self->pingint / 2); } $self->state('init'); $self->pc50_t(time); - $self->pingint($user->pingint || 3*60); - $self->nopings(3); - $self->lastping($main::systime); - $self->pingtime([ ]); Log('DXProt', "$call connected"); } @@ -716,7 +722,7 @@ sub normal if ($tochan) { $tochan->nopings(3); # pump up the timer push @{$tochan->pingtime}, $t; - shift @{$tochan->pingtime} if @{$tochan->pingtime} > 10; + shift @{$tochan->pingtime} if @{$tochan->pingtime} > 6; my $st; for (@{$tochan->pingtime}) { $st += $_;