Commit 2b6b8ff0 authored by Leigh B. Stoller's avatar Leigh B. Stoller

A couple of little fixes for dealing with the situation that an experiment

is not running, and there is no locpiper to connect to. Pop up a dialog
box telling the user.
parent 71621c1a
......@@ -280,8 +280,9 @@ while (1) {
$newconn++;
}
#
# We need to *something* to brand new connections to keep the client
# from timing out (happens on my desktop).
# We need to send *something* to brand new connections to keep the
# client from timing out on the initial reply from the server
# (this happens on my desktop; firefox).
#
if ($newconn) {
SendBatteryData(1);
......
......@@ -1226,7 +1226,11 @@ public class RoboTrack extends JApplet {
catch(Throwable th)
{
th.printStackTrace();
daemon = null;
thread = null;
MyDialog("RoboPipe",
"Could not connect to pipe; " +
"is there an experiment running?");
return;
}
}
......@@ -1243,6 +1247,8 @@ public class RoboTrack extends JApplet {
if (thread == null)
break;
}
if (str == null)
break;
}
catch(IOException e)
{
......@@ -1257,6 +1263,7 @@ public class RoboTrack extends JApplet {
break;
}
}
System.out.println("Returning from main thread");
thread = null;
destroy();
}
......
......@@ -83,9 +83,13 @@ function SPEWCLEANUP()
set_time_limit(0);
register_shutdown_function("SPEWCLEANUP");
# Avoid PHP error reporting in sockopen that confuse the headers.
error_reporting(0);
$socket = fsockopen("localhost", 9005);
if (!$socket) {
TBERROR("Error opening locpiper socket - $errstr",1);
header("HTTP/1.0 404 Error opening locpiper socket - $errstr");
exit();
}
while (! feof($socket)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment