diff --git a/src/Connection.php b/src/Connection.php index 6b01479..a197b91 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -37,6 +37,11 @@ abstract class Connection $this->close(); } + public function isConnected(): bool + { + return !$this->stream instanceof NullStream; + } + /** * @return Promise */