浏览代码

Merge pull request #437 from ares333/master

Discard sending data when status is connecting on close.
walkor 6 年之前
父节点
当前提交
e8415bb87c
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      Connection/TcpConnection.php

+ 4 - 0
Connection/TcpConnection.php

@@ -836,6 +836,10 @@ class TcpConnection extends ConnectionInterface
      */
     public function close($data = null, $raw = false)
     {
+        if($this->_status === self::STATUS_CONNECTING){
+            $this->destroy();
+            return;
+        }
         if ($this->_status === self::STATUS_CLOSING || $this->_status === self::STATUS_CLOSED) {
             return;
         } else {