Posted on 2007-06-20 16:01:37-07 by calli in response to 5476
Re: pls a little help, kind of howto..
The problem occurs when a client drops its connection. Once the whole program stops absolutely nothing happend so it seems that both initial threads were blocked, another time only the first thread was blocked and the second thread one tries to make 'him' work again, but the second does not print out anything to the logfile ?? Could it be a problem that the Writer does this:
foreach my $f ( liesFiles($tmpMinDir) ) { next unless ( $f && (-s $f) ); print $SOC "# \tNow $thisPC will send you quotes of zip-file:$f, ".(-s $f)." bytes $EOL" +; open( SAVEOUT, ">&STDOUT" ) or warn "can't save stdout: $!\n"; open( STDOUT, ">&", $SOC ) or warn "can't dup to stdout: $!\n"; if ($f =~ /\.zip/) { system('nice','-1','unzip', '-p', $f ); } else { system('nice','-1','cat', $f); } open( STDOUT, ">&SAVEOUT" ) or warn "can't restore stdout: $!\n"; }
Do the threads have different STDIN and STDOUT? But the Writer is killed only after the cond_broadcast(@chat) of the Reader..? I derived my program, from a threaded-chat server, that I once programed and that you can
load from here: http://www.perlmonks.net/index.pl?node_id=473566. May be that even this wont work anymore propperly? Cheers,Carl
Direct Responses: 5490 | Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.