X-Git-Url: http://scm.dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXChannel.pm;h=5505610e9752b8520f6270733fdc0b1387185bc0;hb=5d197c9f7aa2ea796d86aa5473f93956b24cf1b7;hp=8f641a443c5d497dedb5322a077da674bb986a12;hpb=d5b4190c36f130852973121042876af3c5642cd7;p=spider.git diff --git a/perl/DXChannel.pm b/perl/DXChannel.pm index 8f641a44..5505610e 100644 --- a/perl/DXChannel.pm +++ b/perl/DXChannel.pm @@ -210,6 +210,7 @@ sub state if (@_) { $self->{oldstate} = $self->{state}; $self->{state} = shift; + $self->{func} = '' unless defined $self->{func}; dbg('state', "$self->{call} channel func $self->{func} state $self->{oldstate} -> $self->{state}\n"); } return $self->{state}; @@ -230,6 +231,22 @@ sub disconnect $self->del(); } +# +# just close all the socket connections down without any fiddling about, cleaning, being +# nice to other processes and otherwise telling them what is going on. +# +# This is for the benefit of forked processes to prepare for starting new programs, they +# don't want or need all this baggage. +# + +sub closeall +{ + my $ref; + foreach $ref (values %channels) { + $ref->{conn}->disconnect() if $ref->{conn}; + } +} + # various access routines #