mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-27 01:39:22 +02:00
* new configurable: status_timeout
This commit is contained in:
parent
887c792a76
commit
82d6467cee
@ -233,6 +233,7 @@ $config = array(
|
|||||||
// status, took automatically from config file if empty
|
// status, took automatically from config file if empty
|
||||||
'status_ip' => '',
|
'status_ip' => '',
|
||||||
'status_port' => '',
|
'status_port' => '',
|
||||||
|
'status_timeout' => 2, // how long to wait for the initial response from the server (default: 2 seconds)
|
||||||
|
|
||||||
// other
|
// other
|
||||||
'anonymous_usage_statistics' => true,
|
'anonymous_usage_statistics' => true,
|
||||||
|
@ -50,15 +50,14 @@ class OTS_ServerInfo
|
|||||||
/**
|
/**
|
||||||
* Sends packet to server.
|
* Sends packet to server.
|
||||||
*
|
*
|
||||||
* @param OTS_Buffer $packet Buffer to send.
|
* @param OTS_Buffer|string $packet Buffer to send.
|
||||||
* @return OTS_Buffer|null Respond buffer (null if server is offline).
|
* @return OTS_Buffer|null Respond buffer (null if server is offline).
|
||||||
* @throws E_OTS_OutOfBuffer When there is read attemp after end of packet stream.
|
* @throws E_OTS_OutOfBuffer When there is read attemp after end of packet stream.
|
||||||
*/
|
*/
|
||||||
private function send(OTS_Buffer $packet)
|
private function send(OTS_Buffer $packet)
|
||||||
{
|
{
|
||||||
// connects to server
|
// connects to server
|
||||||
// gives maximum 5 seconds to connect
|
$socket = @fsockopen($this->server, $this->port, $error, $message, config('status_timeout'));
|
||||||
$socket = @fsockopen($this->server, $this->port, $error, $message, 5);
|
|
||||||
|
|
||||||
// if connected then checking statistics
|
// if connected then checking statistics
|
||||||
if($socket)
|
if($socket)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user