Ver código fonte

fix ws asyncTcpConnection reconnect

walkor 9 anos atrás
pai
commit
e7fbed0d7e
1 arquivos alterados com 2 adições e 0 exclusões
  1. 2 0
      Protocols/Ws.php

+ 2 - 0
Protocols/Ws.php

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