[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gpsd-dev] [PATCH 2/2] gpsd.php: Increase the delays before reading GPSd
From: |
Beat Bolli |
Subject: |
[gpsd-dev] [PATCH 2/2] gpsd.php: Increase the delays before reading GPSd's answer. |
Date: |
Mon, 9 Apr 2012 14:30:16 +0200 |
This was needed on my Intel Atom server to prevent a stuck PHP script.
---
gpsd.php.in | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gpsd.php.in b/gpsd.php.in
index ec8f52c..1e32d8e 100644
--- a/gpsd.php.in
+++ b/gpsd.php.in
@@ -88,8 +88,9 @@ if (isset($_GET['imgdata']) && $op == 'view'){
if ($testmode){
$sock = @fsockopen($server, $port, $errno, $errstr, 2);
@fwrite($sock, "?WATCH={\"enable\":true}\n");
- usleep(100);
+ usleep(1000);
@fwrite($sock, "?POLL;\n");
+ usleep(1000);
for($tries = 0; $tries < 10; $tries++){
$resp = @fread($sock, 2000); # SKY can be pretty big
if (preg_match('/{"class":"POLL".+}/i', $resp, $m)){
--
1.7.9.5