Răsfoiți Sursa

Merge pull request #437 from ares333/master

Discard sending data when status is connecting on close.
walkor 6 ani în urmă
părinte
comite
e8415bb87c
1 a modificat fișierele cu 4 adăugiri și 0 ștergeri
  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 {