}
}
-sub process
+sub process_one
{
- foreach my $dxchan (get_all()) {
- next if $dxchan->{disconnecting};
+ my $self = shift;
+
+ while (my $data = shift @{$self->{inqueue}}) {
+ my ($sort, $call, $line) = $self->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');
- 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');
-
- # handle A records
- my $user = $dxchan->user;
- if ($sort eq 'A' || $sort eq 'O') {
- $dxchan->start($line, $sort);
- } elsif ($sort eq 'I') {
- die "\$user not defined for $call" if !defined $user;
+ # handle A records
+ my $user = $self->user;
+ if ($sort eq 'A' || $sort eq 'O') {
+ $self->start($line, $sort);
+ } elsif ($sort eq 'I') {
+ die "\$user not defined for $call" if !defined $user;
- # normal input
- $dxchan->normal($line);
- } elsif ($sort eq 'Z') {
- $dxchan->disconnect;
- } elsif ($sort eq 'D') {
- ; # ignored (an echo)
- } elsif ($sort eq 'G') {
- $dxchan->enhanced($line);
- } else {
- print STDERR atime, " Unknown command letter ($sort) received from $call\n";
- }
+ # normal input
+ $self->normal($line);
+ } elsif ($sort eq 'Z') {
+ $self->disconnect;
+ } elsif ($sort eq 'D') {
+ ; # ignored (an echo)
+ } elsif ($sort eq 'G') {
+ $self->enhanced($line);
+ } else {
+ dbg atime . " Unknown command letter ($sort) received from $call\n";
}
}
}
+sub process
+{
+ foreach my $dxchan (get_all()) {
+ next if $dxchan->{disconnecting};
+ $dxchan->process_one;
+ }
+}
+
sub handle_xml
{
my $self = shift;
{
my $timenow = time;
+ BPQMsg::process();
DXChannel::process();
# $DB::trace = 0;
DXDb::process();
DXUser::process();
DXDupe::process();
- $systime_days = $days;
- $systime_daystart = $days * 86400;
- }
- IsoTime::update($systime);
- DXCron::process(); # do cron jobs
- DXCommandmode::process(); # process ongoing command mode stuff
- DXXml::process();
- DXProt::process(); # process ongoing ak1a pcxx stuff
- DXConnect::process();
- DXMsg::process();
- DXDb::process();
- DXUser::process();
- DXDupe::process();
- AGWMsg::process();
- BPQMsg::process();
+ DXCron::process(); # do cron jobs
+ IsoTime::update($systime);
+ DXProt::process(); # process ongoing ak1a pcxx stuff
+ DXConnect::process();
+ DXUser::process();
+ AGWMsg::process();
+
+ Timer::handler();
- Timer::handler();
+ }
if (defined &Local::process) {
eval {