X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2Fclient.pl;h=9f39fdd135c42e22cc1a2249528e06edfaf6fdb4;hb=2a39cb7fe81a46b5d227c0e02857463b93678cfa;hp=376587645c8599abb15b2bb43ac82238afad2722;hpb=918827ec5a9023edeb2ce0140692566591af0af8;p=spider.git diff --git a/perl/client.pl b/perl/client.pl index 37658764..9f39fdd1 100755 --- a/perl/client.pl +++ b/perl/client.pl @@ -53,6 +53,7 @@ sub cease my $sendz = shift; if ($conn && $sendz) { $conn->send_now("Z$call|bye...\n"); + sleep(1); } $stdout->flush if $stdout; if ($pid) { @@ -62,6 +63,9 @@ sub cease dbgclose(); # $SIG{__WARN__} = sub {my $a = shift; cluck($a); }; sleep(1); + + # do we need this ? + $conn->disconnect if $conn; exit(0); } @@ -270,6 +274,10 @@ sub dochat $line = <$rfh>; $line =~ s/\r//og; } + if (length $line == 0) { + dbg('connect', "received 0 length line, aborting..."); + cease(11); + } dbg('connect', "received \"$line\""); if ($abort && $line =~ /$abort/i) { dbg('connect', "aborted on /$abort/"); @@ -493,7 +501,7 @@ Msg->set_event_handler($stdin, "read" => \&rec_stdin); for (;;) { my $t; - Msg->event_loop(1, 0.010); + Msg->event_loop(1, 1); $t = time; if ($t > $lasttime) { if ($outqueue) {