From b7c25a30cbd2701ada5237563c4ac962d6ce2395 Mon Sep 17 00:00:00 2001 From: lin <465382251@qq.com> Date: Fri, 20 Aug 2021 09:53:49 +0800 Subject: [PATCH] Clear public cached data --- src/Api/WebSocketV3/SocketServer.php | 3 +++ src/Api/WebSocketV5/SocketServer.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/Api/WebSocketV3/SocketServer.php b/src/Api/WebSocketV3/SocketServer.php index de2fccf..52c7173 100644 --- a/src/Api/WebSocketV3/SocketServer.php +++ b/src/Api/WebSocketV3/SocketServer.php @@ -158,6 +158,9 @@ private function onClose($global){ if($con->tag=='public'){ $this->log($con->tag.' reconnection'); + //Clear public cached data + foreach ($this->local_global['public'] as $k=>$v) unset($this->local_global['public'][$k]); + $this->reconnection($global,'public'); }else{ $this->log('private connection close,ready to reconnect '.$con->tag_keysecret['key']); diff --git a/src/Api/WebSocketV5/SocketServer.php b/src/Api/WebSocketV5/SocketServer.php index 37b42d0..9b538bd 100644 --- a/src/Api/WebSocketV5/SocketServer.php +++ b/src/Api/WebSocketV5/SocketServer.php @@ -178,6 +178,9 @@ private function onClose($global){ if($con->tag=='public'){ $this->log($con->tag.' reconnection'); + //Clear public cached data + foreach ($this->local_global['public'] as $k=>$v) unset($this->local_global['public'][$k]); + $this->reconnection($global,'public'); }else{ $this->log('private connection close,ready to reconnect '.$con->tag_keysecret['key']);