mirror of
https://github.com/YGGverse/nps-php.git
synced 2025-01-15 09:20:04 +00:00
add socket active validation
This commit is contained in:
parent
f8a0f2e350
commit
003393b129
@ -173,14 +173,17 @@ class Server
|
||||
STREAM_SERVER_BIND | STREAM_SERVER_LISTEN
|
||||
);
|
||||
|
||||
if ($this->_live)
|
||||
{
|
||||
$this->_live = is_resource(
|
||||
$socket
|
||||
);
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
if (!$this->_live)
|
||||
{
|
||||
fclose(
|
||||
$socket
|
||||
);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -289,6 +292,13 @@ class Server
|
||||
);
|
||||
|
||||
} while ($this->_live);
|
||||
|
||||
if (is_resource($socket))
|
||||
{
|
||||
fclose(
|
||||
$socket
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function stop(): void
|
||||
|
Loading…
x
Reference in New Issue
Block a user