--- loncom/lonmaxima 2006/05/10 01:08:01 1.18 +++ loncom/lonmaxima 2006/05/10 02:21:19 1.21 @@ -3,7 +3,7 @@ # The LearningOnline Network with CAPA # Connect to MAXIMA CAS # -# $Id: lonmaxima,v 1.18 2006/05/10 01:08:01 www Exp $ +# $Id: lonmaxima,v 1.21 2006/05/10 02:21:19 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -31,7 +31,6 @@ # use Expect; -use IPC::Open3; use IO::Select; use IO::Socket; use IO::File; @@ -255,10 +254,10 @@ sub make_new_child { &status('Accepting connections'); my $client = $server->accept() or last; print $command "kill(all);reset();\n"; - &getmaximaoutput($command); + &getmaximaoutput($command); + &sync($command); while (my $cmd=<$client>) { &status('Processing command'); - &sync($command); print $command &unescape($cmd); my $reply=&getmaximaoutput($command); print $client &escape($reply)."\n"; @@ -267,7 +266,8 @@ sub make_new_child { $client->close(); $command->hard_close(); exit; - } + } + &sync($command); &status('Waiting for commands'); } }