|
|
@ -3,7 +3,7 @@ session_start(); |
|
|
|
# |
|
|
|
# |
|
|
|
global $doctype, $title, $miner, $port, $readonly, $notify, $rigs; |
|
|
|
global $doctype, $title, $miner, $port, $readonly, $notify, $rigs; |
|
|
|
global $mcast, $mcastexpect, $mcastaddr, $mcastport, $mcastcode; |
|
|
|
global $mcast, $mcastexpect, $mcastaddr, $mcastport, $mcastcode; |
|
|
|
global $mcastlistport, $mcasttimeout, $allowgen; |
|
|
|
global $mcastlistport, $mcasttimeout, $mcastretries, $allowgen; |
|
|
|
global $rigipsecurity, $rigtotals, $forcerigtotals; |
|
|
|
global $rigipsecurity, $rigtotals, $forcerigtotals; |
|
|
|
global $socksndtimeoutsec, $sockrcvtimeoutsec; |
|
|
|
global $socksndtimeoutsec, $sockrcvtimeoutsec; |
|
|
|
global $checklastshare, $poolinputs, $hidefields; |
|
|
|
global $checklastshare, $poolinputs, $hidefields; |
|
|
@ -70,6 +70,9 @@ $mcastlistport = 4027; |
|
|
|
# to wait for replies to the Multicast message |
|
|
|
# to wait for replies to the Multicast message |
|
|
|
$mcasttimeout = 1.5; |
|
|
|
$mcasttimeout = 1.5; |
|
|
|
# |
|
|
|
# |
|
|
|
|
|
|
|
# Set $mcastretries to the number of times to retry the multicast |
|
|
|
|
|
|
|
$mcastretries = 0; |
|
|
|
|
|
|
|
# |
|
|
|
# Set $allowgen to true to allow customsummarypages to use 'gen' |
|
|
|
# Set $allowgen to true to allow customsummarypages to use 'gen' |
|
|
|
# false means ignore any 'gen' options |
|
|
|
# false means ignore any 'gen' options |
|
|
|
$allowgen = false; |
|
|
|
$allowgen = false; |
|
|
@ -375,8 +378,8 @@ $error = null; |
|
|
|
# |
|
|
|
# |
|
|
|
function getrigs() |
|
|
|
function getrigs() |
|
|
|
{ |
|
|
|
{ |
|
|
|
global $rigs, $mcastaddr, $mcastport, $mcastcode; |
|
|
|
global $rigs, $mcastexpect, $mcastaddr, $mcastport, $mcastcode; |
|
|
|
global $mcastlistport, $mcasttimeout, $error; |
|
|
|
global $mcastlistport, $mcasttimeout, $mcastretries, $error; |
|
|
|
|
|
|
|
|
|
|
|
$listname = "0.0.0.0"; |
|
|
|
$listname = "0.0.0.0"; |
|
|
|
|
|
|
|
|
|
|
@ -414,6 +417,10 @@ function getrigs() |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$retries = $mcastretries; |
|
|
|
|
|
|
|
$doretry = ($retries > 0); |
|
|
|
|
|
|
|
do |
|
|
|
|
|
|
|
{ |
|
|
|
$mcast_soc = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); |
|
|
|
$mcast_soc = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); |
|
|
|
if ($mcast_soc === false || $mcast_soc == null) |
|
|
|
if ($mcast_soc === false || $mcast_soc == null) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -464,6 +471,12 @@ function getrigs() |
|
|
|
|
|
|
|
|
|
|
|
usleep(100000); |
|
|
|
usleep(100000); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($mcastexpect > 0 && count($rigs) >= $mcastexpect) |
|
|
|
|
|
|
|
$doretry = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} while ($doretry && --$retries > 0); |
|
|
|
|
|
|
|
|
|
|
|
socket_close($rep_soc); |
|
|
|
socket_close($rep_soc); |
|
|
|
} |
|
|
|
} |
|
|
|
# |
|
|
|
# |
|
|
|