Browse Source

add connection close

main 1.1.1
ghost 11 months ago
parent
commit
cc9ddf3647
  1. 11
      src/Socket.php

11
src/Socket.php

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

Loading…
Cancel
Save