Cleanup unused socket resources

This commit is contained in:
Daniil Gentili 2018-02-20 15:06:39 +00:00
parent 816003fa92
commit bafe907df0

View File

@ -103,7 +103,8 @@ If not, see <http://www.gnu.org/licenses/>.
public function close() public function close()
{ {
return fclose($this->sock); fclose($this->sock);
$this->sock = null;
} }
public function getPeerName(bool $port = true) public function getPeerName(bool $port = true)
@ -198,7 +199,8 @@ if (!extension_loaded('pthreads')) {
public function close() public function close()
{ {
return socket_close($this->sock); socket_close($this->sock);
$this->sock = null;
} }
public function getPeerName(bool $port = true) public function getPeerName(bool $port = true)