mirror of
https://github.com/YGGverse/net-php.git
synced 2025-03-13 05:51:23 +00:00
require internal validation
This commit is contained in:
parent
b3ff41751d
commit
26315c924f
@ -30,14 +30,19 @@ class Socket
|
||||
|
||||
public static function isOpen(string $host, int $port = -1, ?float $timeout = null, int &$error_code = null, string &$error_message = null): bool
|
||||
{
|
||||
return is_resource(
|
||||
@fsockopen(
|
||||
$host,
|
||||
$port,
|
||||
$error_code,
|
||||
$error_message,
|
||||
$timeout
|
||||
)
|
||||
);
|
||||
if (self::isHost($host) && self::isPort($port))
|
||||
{
|
||||
return is_resource(
|
||||
@fsockopen(
|
||||
$host,
|
||||
$port,
|
||||
$error_code,
|
||||
$error_message,
|
||||
$timeout
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user