X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXChannel.pm;h=64a9a1ae5b7c153608c19416f95d64ebb287fa67;hb=ed2d469812ca5ab82baab7f8b4795660e01ef539;hp=584a541c1244e44a8b3f1ae90e22b09a8b72e793;hpb=370d3563d7df44b754549330fb640051f7c31889;p=spider.git diff --git a/perl/DXChannel.pm b/perl/DXChannel.pm index 584a541c..64a9a1ae 100644 --- a/perl/DXChannel.pm +++ b/perl/DXChannel.pm @@ -125,6 +125,7 @@ $count = 0; inqueue => '9,Input Queue,parray', next_pc92_update => '9,Next PC92 Update,atime', next_pc92_keepalive => '9,Next PC92 KeepAlive,atime', + anyevents => '9,outstanding AnyEvent handles,parray', ); $maxerrors = 20; # the maximum number of concurrent errors allowed before disconnection @@ -179,6 +180,7 @@ sub alloc $self->{cq} = $dxcc[1]->cq; } $self->{inqueue} = []; + $self->{anyevents} = []; $count++; dbg("DXChannel $self->{call} created ($count)") if isdbg('chan'); @@ -752,6 +754,25 @@ sub handle_xml return $r; } +sub anyevent_add +{ + my $self = shift; + my $handle = shift; + my $sort = shift || "unknown"; + + push @{$self->{anyevents}}, $handle; + dbg("anyevent: add $sort handle making " . scalar @{$self->{anyevents}} . " handles in use") if isdbg('anyevent'); +} + +sub anyevent_del +{ + my $self = shift; + my $handle = shift; + my $sort = shift || "unknown"; + $self->{anyevents} = [ grep {$_ != $handle} @{$self->{anyevents}} ]; + dbg("anyevent: delete $sort handle making " . scalar @{$self->{anyevents}} . " handles in use") if isdbg('anyevent'); +} + #no strict; sub AUTOLOAD {