diff --git a/miner.php b/miner.php index 6f750be9..be420aa6 100644 --- a/miner.php +++ b/miner.php @@ -1,7 +1,8 @@ = SND +# Feel free to increase SND if your network is very slow +# or decrease RCV if that happens often to you # Also, on some windows PHP, apparently the $usec is ignored -$socktimeoutsec = 10; +$socksndtimeoutsec = 10; +$sockrcvtimeoutsec = 40; # # List of fields NOT to be displayed # You can use this to hide data you don't want to see or don't want @@ -260,7 +265,7 @@ $error = null; # function getsock($addr, $port) { - global $haderror, $error, $socktimeoutsec; + global $haderror, $error, $socksndtimeoutsec, $sockrcvtimeoutsec; $error = null; $socket = null; @@ -277,7 +282,8 @@ function getsock($addr, $port) // Ignore if this fails since the socket connect may work anyway // and nothing is gained by aborting if the option cannot be set // since we don't know in advance if it can connect - socket_set_option($socket, SOL_SOCKET, SO_SNDTIMEO, array('sec' => $socktimeoutsec, 'usec' => 0)); + socket_set_option($socket, SOL_SOCKET, SO_SNDTIMEO, array('sec' => $socksndtimeoutsec, 'usec' => 0)); + socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, array('sec' => $sockrcvtimeoutsec, 'usec' => 0)); $res = socket_connect($socket, $addr, $port); if ($res === false)