From 3431c4435940cbfefc1c0ad2986fdf87b6d80669 Mon Sep 17 00:00:00 2001 From: Eugene Leonovich Date: Wed, 21 Feb 2018 16:54:05 +0100 Subject: [PATCH] Enhance StreamConnection::isClosed() detection Sometimes when dealing with amphp StreamConnection::$stream reset to 0 --- src/Connection/StreamConnection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Connection/StreamConnection.php b/src/Connection/StreamConnection.php index 77910654..f43848c3 100644 --- a/src/Connection/StreamConnection.php +++ b/src/Connection/StreamConnection.php @@ -64,7 +64,7 @@ public function close() public function isClosed() { - return null === $this->stream; + return !\is_resource($this->stream); } public function send($data)