2. Added G0RDI's 'links' command.
+17Jun00=======================================================================
+1. I believe I have fixed all the login/logout 'broken pipe' errors
+2. Added G0RDI's 'links' command.
14Jun00=======================================================================
1. fixed sh/node crash
2. fixed RTT in who.pl
This uses the subject field, so any messages that have exactly the same subject
will be deleted. Beware!
+=== 0^LINKS^Show which nodes is physically connected
+This is a quick listing that shows which links are connected and
+some information about them. See WHO for a list of all connections.
+
=== 9^LOAD/ALIASES^Reload the command alias table
Reload the /spider/cmd/Aliases file after you have editted it. You will need to
do this if you change this file whilst the cluster is running in order for the
--- /dev/null
+#
+# links : which are active
+# a complete list of currently connected linked nodes
+#
+# Created by Iain Philipps G0RDI, based entirely on
+# who.pl, which is Copyright (c) 1999 Dirk Koopman G1TLH
+#
+# 16-Jun-2000
+# $Id: links.pl
+
+
+my $self = shift;
+my $dxchan;
+my @out;
+
+push @out, " Callsign Started Ave RTT";
+
+foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all_ak1a ) {
+ my $call = $dxchan->call();
+ my $t = cldatetime($dxchan->startt);
+ my $name = $dxchan->user->name || " ";
+ my $ping = $dxchan->is_node && $dxchan != $DXProt::me ? sprintf("%8.2f",
+ $dxchan->pingave) : "";
+ push @out, sprintf "%10s $t %-6.6s $ping", $call;
+
+}
+
+return (1, @out)
+
+
+
+
my $user = $self->{user};
my $conn = $self->{conn};
my $call = $self->{call};
- my $nopc39 = shift || 0;
- $self->finish($nopc39);
- $conn->send_now("Z$call|bye") if $conn; # this will cause 'client' to disconnect
+ $self->finish($conn);
$user->close() if defined $user;
$conn->disconnect() if $conn;
$self->del();
sub finish
{
my $self = shift;
+ my $conn = shift;
my $call = $self->call;
# I was the last node visited
$self->user->node($main::mycall);
# log out text
- if (-e "$main::data/logout") {
+ if ($conn && -e "$main::data/logout") {
open(I, "$main::data/logout") or confess;
my @in = <I>;
close(I);
{
my $self = shift;
my $call = $self->call;
- my $nopc39 = shift;
+ my $conn = shift;
my $ref = DXCluster->get_exact($call);
- $self->send_now("D", DXProt::pc39($main::mycall, $self->msg('disc1', "System Op"))) unless $nopc39;
-
# unbusy and stop and outgoing mail
my $mref = DXMsg::get_busy($call);
$mref->stop_msg($call) if $mref;
route(undef, $to, pc34($main::mycall, $to, $cmd));
}
}
+
+sub disconnect
+{
+ my $self = shift;
+ my $nopc39 = shift;
+
+ if ($self->{conn} && !$nopc39) {
+ $self->send_now("D", DXProt::pc39($main::mycall, $self->msg('disc1', "System Op")));
+ }
+
+ $self->SUPER::disconnect;
+}
1;
__END__
sub cease
{
my $sendz = shift;
- if ($conn && $sendz) {
- $conn->send_now("Z$call|bye...");
- sleep(1);
- }
+# if ($conn && $sendz) {
+# $conn->send_now("Z$call|bye...");
+# sleep(1);
+# }
$stdout->flush if $stdout;
if ($pid) {
dbg('connect', "killing $pid");
{
my ($con, $msg, $err) = @_;
if (defined $err && $err) {
- cease(1);
+ cease(0);
}
if (defined $msg) {
my ($sort, $call, $line) = $msg =~ /^(\w)([^\|]+)\|(.*)$/;
# any other sorts that might happen are silently ignored.
# ******************************************************
# ******************************************************
+ } else {
+ cease(0);
}
$lasttime = time;
}
if (!defined $msg || (defined $err && $err)) {
if ($dxchan) {
+ if (defined $err) {
+ $conn->disconnect;
+ undef $conn;
+ $dxchan->conn(undef);
+ }
$dxchan->disconnect;
} elsif ($conn) {
$conn->disconnect;
#open(DB::OUT, "|tee /tmp/aa");
+$SIG{PIPE} = sub {
+ #$DB::single = 1;
+ dbg('err', "Broken PIPE signal received");
+};
+
for (;;) {
my $timenow;
# $DB::trace = 1;
sub cease
{
my $sendz = shift;
- if ($conn && $sendz) {
- $conn->send_now("Z$call|bye...");
- }
+# if ($conn && $sendz) {
+# $conn->send_now("Z$call|bye...");
+# }
endwin();
dbgclose();
print @_ if @_;
# any other sorts that might happen are silently ignored.
# ******************************************************
# ******************************************************
+ } else {
+ cease(0);
}
$top->refresh();
$lasttime = time;
void terminate(int i)
{
+#if 0
if (node && send_Z && call) {
send_msg(node, 'Z', "bye", 3);
}
+#endif
signal(SIGALRM, term_timeout);
alarm(10);