+
+ # calc smoothed RTT a la TCP
+ if (@{$tochan->{pingtime}} == 1) {
+ $tochan->{pingave} = $t;
+ } else {
+ $tochan->{pingave} = $tochan->{pingave} + (($t - $tochan->{pingave}) / 6);
+ }
+# my $st;
+# for (@{$tochan->{pingtime}}) {
+# $st += $_;
+# }
+# $tochan->{pingave} = $st / @{$tochan->{pingtime}};
+ $tochan->{nopings} = $nopings; # pump up the timer