mirror of
https://github.com/YGGverse/net-php.git
synced 2025-03-13 05:51:23 +00:00
add connection close
This commit is contained in:
parent
a64b7ac816
commit
cc9ddf3647
@ -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…
x
Reference in New Issue
Block a user