mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +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_ip' => '',
|
||||
'status_port' => '',
|
||||
'status_timeout' => 2, // how long to wait for the initial response from the server (default: 2 seconds)
|
||||
|
||||
// other
|
||||
'anonymous_usage_statistics' => true,
|
||||
|
@ -50,15 +50,14 @@ class OTS_ServerInfo
|
||||
/**
|
||||
* 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).
|
||||
* @throws E_OTS_OutOfBuffer When there is read attemp after end of packet stream.
|
||||
*/
|
||||
private function send(OTS_Buffer $packet)
|
||||
{
|
||||
// connects to server
|
||||
// gives maximum 5 seconds to connect
|
||||
$socket = @fsockopen($this->server, $this->port, $error, $message, 5);
|
||||
$socket = @fsockopen($this->server, $this->port, $error, $message, config('status_timeout'));
|
||||
|
||||
// if connected then checking statistics
|
||||
if($socket)
|
||||
|
Loading…
x
Reference in New Issue
Block a user