瀏覽代碼

check valid stream

walkor 6 年之前
父節點
當前提交
89831799e9
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Connection/AsyncTcpConnection.php

+ 1 - 1
Connection/AsyncTcpConnection.php

@@ -189,7 +189,7 @@ class AsyncTcpConnection extends TcpConnection
                 STREAM_CLIENT_ASYNC_CONNECT);
         }
         // If failed attempt to emit onError callback.
-        if (!$this->_socket) {
+        if (!$this->_socket || !is_resource($this->_socket)) {
             $this->emitError(WORKERMAN_CONNECT_FAIL, $errstr);
             if ($this->_status === self::STATUS_CLOSING) {
                 $this->destroy();