mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Added timeout to Utils::getOnline(), fixes #1071 [gh#1071]
This commit is contained in:
parent
b63e49acf8
commit
70445bdeba
@ -28,7 +28,7 @@ class Utils{
|
||||
public static $ip = false;
|
||||
|
||||
public static function isOnline(){
|
||||
return ((@fsockopen("google.com", 80) !== false or @fsockopen("www.linux.org", 80) !== false or @fsockopen("www.php.net", 80) !== false) ? true:false);
|
||||
return ((@fsockopen("google.com", 80, $e = null, $n = null, 2) !== false or @fsockopen("www.linux.org", 80, $e = null, $n = null, 2) !== false or @fsockopen("www.php.net", 80, $e = null, $n = null, 2) !== false) ? true:false);
|
||||
}
|
||||
|
||||
public static function getIP($force = false){
|
||||
|
Loading…
x
Reference in New Issue
Block a user