소스 검색

长连接处理完数据清空buffer、

walkor 11 년 전
부모
커밋
0ee53e5591
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      applications/ChatDemo/Bootstrap/Gateway.php

+ 1 - 0
applications/ChatDemo/Bootstrap/Gateway.php

@@ -293,6 +293,7 @@ class Gateway extends Man\Core\SocketWorker
                 $this->notice('CODE:' . $e->getCode() . ' MESSAGE:' . $e->getMessage()."\n".$e->getTraceAsString()."\nCLIENT_IP:".$this->getRemoteIp()."\nBUFFER:[".var_export($this->recvBuffers[$fd]['buf'],true)."]\n");
                 $this->statusInfo['throw_exception'] ++;
             }
+            $this->recvBuffers[$fd] = array('buf'=>'', 'remain_len'=>$this->prereadLength);
         }
         // 出错
         else if(false === $remain_len)