my $ref;
return (1, $self->msg('e5')) unless $self->priv >= 5;
foreach $ref (DXChannel::get_all()) {
- $ref->send_now("D", DXProt::pc39($main::mycall, "Shutdown by $call")) if $ref->is_node && $ref != $DXProt::me;
- $ref->send_now("D", $self->msg('shutting')) if $ref->is_user;
+ $ref->send($self->msg('shutting')) if $ref->is_user;
}
# give some time for the buffers to empty and then shutdown (see cluster.pl)
-$main::decease = 250;
-
+$main::decease = 25;
return (1);
dbg('local', "Local::finish error $@") if $@;
# disconnect nodes
- foreach $dxchan (DXChannel->get_all()) {
- next unless $dxchan->is_node;
- $dxchan->disconnect unless $dxchan == $DXProt::me;
+ foreach $dxchan (DXChannel->get_all_nodes) {
+ $dxchan->disconnect(2) unless $dxchan == $DXProt::me;
}
- Msg->event_loop(1, 0.05);
- Msg->event_loop(1, 0.05);
+ Msg->event_loop(100, 0.01);
# disconnect users
- foreach $dxchan (DXChannel->get_all()) {
- next if $dxchan->is_node;
- $dxchan->disconnect(2) unless $dxchan == $DXProt::me;
+ foreach $dxchan (DXChannel->get_all_users) {
+ $dxchan->disconnect;
}
# disconnect AGW
AGWMsg::finish();
-
- Msg->event_loop(1, 0.05);
- Msg->event_loop(1, 0.05);
- Msg->event_loop(1, 0.05);
- Msg->event_loop(1, 0.05);
- Msg->event_loop(1, 0.05);
- Msg->event_loop(1, 0.05);
+
+ # end everything else
+ Msg->event_loop(100, 0.01);
DXUser::finish();
DXDupe::finish();