Skip to content

Commit

Permalink
wait 10 seconds instead of 5.
Browse files Browse the repository at this point in the history
  • Loading branch information
Xinecraft committed Jun 14, 2024
1 parent b0cc9ba commit 761b093
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Utils/MinecraftQuery/MinecraftWebQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ public function sendQuery($type, array $data = [])
$encrypted = $this->makePayload($type, $data);

$factory = new \Socket\Raw\Factory();
$socket = $factory->createClient("tcp://{$this->HOST}:{$this->PORT}", 5);
$socket = $factory->createClient("tcp://{$this->HOST}:{$this->PORT}", 10);
$text = $encrypted."\n";
$socket->write($text);
// Timeout after 10 seconds for webquery in case of no response
socket_set_option($socket->getResource(), SOL_SOCKET, SO_RCVTIMEO, ['sec' => 5, 'usec' => 0]);
socket_set_option($socket->getResource(), SOL_SOCKET, SO_RCVTIMEO, ['sec' => 10, 'usec' => 0]);
// read while we get data
$buf = '';
while ($read = $socket->read(4096)) {
Expand Down

0 comments on commit 761b093

Please sign in to comment.