mirror of
https://github.com/YGGverse/net-php.git
synced 2026-04-01 17:45:38 +00:00
require internal validation
This commit is contained in:
parent
b3ff41751d
commit
26315c924f
1 changed files with 14 additions and 9 deletions
|
|
@ -29,6 +29,8 @@ class Socket
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function isOpen(string $host, int $port = -1, ?float $timeout = null, int &$error_code = null, string &$error_message = null): bool
|
public static function isOpen(string $host, int $port = -1, ?float $timeout = null, int &$error_code = null, string &$error_message = null): bool
|
||||||
|
{
|
||||||
|
if (self::isHost($host) && self::isPort($port))
|
||||||
{
|
{
|
||||||
return is_resource(
|
return is_resource(
|
||||||
@fsockopen(
|
@fsockopen(
|
||||||
|
|
@ -40,4 +42,7 @@ class Socket
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue