mirror of
https://github.com/YGGverse/nex-php.git
synced 2026-03-31 09:45:28 +00:00
add socket active validation
This commit is contained in:
parent
7923fea04e
commit
55b4c879e4
1 changed files with 14 additions and 4 deletions
|
|
@ -108,14 +108,17 @@ class Server
|
|||
STREAM_SERVER_BIND | STREAM_SERVER_LISTEN
|
||||
);
|
||||
|
||||
if ($this->_live)
|
||||
{
|
||||
$this->_live = is_resource(
|
||||
$socket
|
||||
);
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
if (!$this->_live)
|
||||
{
|
||||
fclose(
|
||||
$socket
|
||||
);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -160,6 +163,13 @@ class Server
|
|||
);
|
||||
|
||||
} while ($this->_live);
|
||||
|
||||
if (is_resource($socket))
|
||||
{
|
||||
fclose(
|
||||
$socket
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function stop(): void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue