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
$self->{cq} = $dxcc[1]->cq;
}
$self->{inqueue} = [];
+ $self->{anyevents} = [];
$count++;
dbg("DXChannel $self->{call} created ($count)") if isdbg('chan');
sub process
{
- foreach my $dxchan (get_all()) {
-
+ foreach my $dxchan (values %channels) {
+
+ next if $dxchan->{disconnecting};
+
while (my $data = shift @{$dxchan->{inqueue}}) {
my ($sort, $call, $line) = $dxchan->decode_input($data);
next unless defined $sort;
# do the really sexy console interface bit! (Who is going to do the TK interface then?)
dbg("<- $sort $call $line") if $sort ne 'D' && isdbg('chan');
- if ($dxchan->{disconnecting}) {
- dbg('In disconnection, ignored');
- next;
- }
# handle A records
my $user = $dxchan->user;
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
{