Browse Source

add connection close

main 1.1.1
ghost 1 year ago
parent
commit
cc9ddf3647
  1. 21
      src/Socket.php

21
src/Socket.php

@ -36,15 +36,20 @@ class Socket @@ -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;

Loading…
Cancel
Save