mirror of
https://github.com/GOSTSec/sgminer
synced 2025-08-26 13:52:02 +00:00
miner.php allow sending the muticast message multiple times
This commit is contained in:
parent
bb0a200fc0
commit
e2829f0c8e
22
API-README
22
API-README
@ -1247,6 +1247,28 @@ N.B. the accuracy of the timing used to wait for the replies is
|
|||||||
|
|
||||||
---------
|
---------
|
||||||
|
|
||||||
|
Default:
|
||||||
|
$mcastretries = 0;
|
||||||
|
|
||||||
|
Set $mcastretries to the number of times to retry the multicast
|
||||||
|
|
||||||
|
If $mcastexpect is 0, this is simply the number of extra times
|
||||||
|
that it will send the multicast request
|
||||||
|
N.B. cgminer doesn't listen for multicast requests for 1000ms after
|
||||||
|
each one it hears
|
||||||
|
|
||||||
|
If $mcastexpect is > 0, it will stop looking for replies once it
|
||||||
|
has found at least $mcastexpect rigs, but it only checks this rig
|
||||||
|
limit each time it reaches the $mcasttimeout limit, thus it can find
|
||||||
|
more than $mcastexpect rigs if more exist
|
||||||
|
It will send the multicast message up to $mcastretries extra times or
|
||||||
|
until it has found at least $mcastexpect rigs
|
||||||
|
However, when using $mcastretries, it is possible for it to sometimes
|
||||||
|
ignore some rigs on the network if $mcastexpect is less than the
|
||||||
|
number of rigs on the network and some rigs are too slow to reply
|
||||||
|
|
||||||
|
---------
|
||||||
|
|
||||||
Default:
|
Default:
|
||||||
$allowgen = false;
|
$allowgen = false;
|
||||||
|
|
||||||
|
19
miner.php
19
miner.php
@ -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);
|
||||||
}
|
}
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user