diff --git a/src/Port.php b/src/Port.php new file mode 100644 index 0000000..3f381c0 --- /dev/null +++ b/src/Port.php @@ -0,0 +1,43 @@ + $length; + } + + 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 + ) + ); + } +} \ No newline at end of file