diff --git a/README.md b/README.md index 23d49dc..24a79e5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # nex-php -PHP 8 Library for NEX Protocol (see also [nps-php](https://github.com/YGGverse/nps-php)) +PHP 8 Library for Nex Protocol (see also [nps-php](https://github.com/YGGverse/nps-php)) ## Usage @@ -10,7 +10,7 @@ composer require yggverse/nex ## Client -PHP interface for NEX protocol queries +PHP interface for Nex protocol queries ``` php $client = new \Yggverse\Nex\Client; @@ -41,7 +41,7 @@ var_dump( ## Server -Build interactive server instance to listen NEX protocol connections! +Build interactive server instance to listen Nex protocol connections! ``` php $server = new \Yggverse\Nex\Server; @@ -91,7 +91,3 @@ $server->start( Stop server instance. Same to `Server::setLive(false)` - -## Integrations - -* [next](https://github.com/YGGverse/next) - PHP 8 Server for NEX Protocol \ No newline at end of file diff --git a/src/Client.php b/src/Client.php index c121c49..45360f2 100644 --- a/src/Client.php +++ b/src/Client.php @@ -113,10 +113,7 @@ class Client sprintf( "%s%s\r\n", $this->_path, - $this->_query ? sprintf( - '?%s', - $this->_query - ) : null + $this->_query ) ); diff --git a/src/Server.php b/src/Server.php index d46be74..a347b27 100644 --- a/src/Server.php +++ b/src/Server.php @@ -108,17 +108,14 @@ class Server STREAM_SERVER_BIND | STREAM_SERVER_LISTEN ); - if ($this->_live) - { - $this->_live = is_resource( - $socket - ); - } - do { if (!$this->_live) { + fclose( + $socket + ); + break; } @@ -163,13 +160,6 @@ class Server ); } while ($this->_live); - - if (is_resource($socket)) - { - fclose( - $socket - ); - } } public function stop(): void