diff --git a/Kafka/Socket.php b/Kafka/Socket.php index 571b810c..4bea1f86 100644 --- a/Kafka/Socket.php +++ b/Kafka/Socket.php @@ -417,7 +417,7 @@ class Socket */ protected function isSocketDead() { - return !is_resource($this->stream) || @feof($this->stream); + return $this->stream instanceof \Swoole\Coroutine\Socket && $this->stream->checkLiveness(); } // }}}