add connection close

This commit is contained in:
ghost 2023-12-16 16:13:26 +02:00
parent a64b7ac816
commit cc9ddf3647

View File

@ -36,15 +36,20 @@ class Socket
{
if (self::isHost($host) && self::isPort($port))
{
return is_resource(
@fsockopen(
$host,
$port,
$error_code,
$error_message,
$timeout
)
$connection = @fsockopen(
$host,
$port,
$error_code,
$error_message,
$timeout
);
if (is_resource($connection))
{
return fclose(
$connection
);
}
}
return false;