Просмотр исходного кода

Merge pull request #437 from ares333/master

Discard sending data when status is connecting on close.
walkor 6 лет назад
Родитель
Сommit
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 {