From bafe907df0d956997ea32365b7ec6e6cf1a4f1c5 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Tue, 20 Feb 2018 15:06:39 +0000 Subject: [PATCH] Cleanup unused socket resources --- src/Socket.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Socket.php b/src/Socket.php index 4f765566..18d9d30d 100644 --- a/src/Socket.php +++ b/src/Socket.php @@ -103,7 +103,8 @@ If not, see . public function close() { - return fclose($this->sock); + fclose($this->sock); + $this->sock = null; } public function getPeerName(bool $port = true) @@ -198,7 +199,8 @@ if (!extension_loaded('pthreads')) { public function close() { - return socket_close($this->sock); + socket_close($this->sock); + $this->sock = null; } public function getPeerName(bool $port = true)