I have a server program which works reasonable well it sits on a remote box with lots of scripts and waits for contact from a client requesting a script top run. this works fine and the following code deals with the comms.
while (my $conn = $sock->accept()){
print $conn `my_script_insrtruction`;
}
This is fine, but some of the jobs take a few hours to run. During the course of the programs they print to STDOUT charting their progress. The output is finally sent to the socket and back to the client at the end of the program.
What I need is a way to stream the program output live to the the socket and the client. The client has the following to accept the input.
while ($buff ne 'end connection'){
$client->recv($buff,1000);
print $buff;
}
Is this possible?