Răsfoiți Sursa

fix ws asyncTcpConnection reconnect

walkor 9 ani în urmă
părinte
comite
e7fbed0d7e
1 a modificat fișierele cu 2 adăugiri și 0 ștergeri
  1. 2 0
      Protocols/Ws.php

+ 2 - 0
Protocols/Ws.php

@@ -281,6 +281,7 @@ class Ws
      */
      */
     public static function onConnect($connection)
     public static function onConnect($connection)
     {
     {
+        $connection->handshakeStep = null;
         self::sendHandshake($connection);
         self::sendHandshake($connection);
     }
     }
 
 
@@ -353,6 +354,7 @@ class Ws
             $connection->consumeRecvBuffer($handshake_respnse_length);
             $connection->consumeRecvBuffer($handshake_respnse_length);
             if (!empty($connection->tmpWebsocketData)) {
             if (!empty($connection->tmpWebsocketData)) {
                 $connection->send($connection->tmpWebsocketData, true);
                 $connection->send($connection->tmpWebsocketData, true);
+                $connection->tmpWebsocketData = '';
             }
             }
             if (strlen($buffer > $handshake_respnse_length)) {
             if (strlen($buffer > $handshake_respnse_length)) {
                 return self::input(substr($buffer, $handshake_respnse_length));
                 return self::input(substr($buffer, $handshake_respnse_length));