From d1b2b24fcf6e6b8e4495b5f888866820e516e903 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Mon, 4 Sep 2023 14:44:35 +0800 Subject: [PATCH] fix --- server/websocket/internal/logic/ws_reuse_last_connect.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/websocket/internal/logic/ws_reuse_last_connect.go b/server/websocket/internal/logic/ws_reuse_last_connect.go index 1a8ea395..faaa062c 100644 --- a/server/websocket/internal/logic/ws_reuse_last_connect.go +++ b/server/websocket/internal/logic/ws_reuse_last_connect.go @@ -61,8 +61,11 @@ func (r *reuseConnProcessor) allocationMessage(w *wsConnectItem, data []byte) { } //重新绑定 logx.Info("开始重新绑定websocket连接标识") + oldUniqueId := w.uniqueId w.uniqueId = wid mapConnPool.Store(wid, *w) + //删除用户id级别之前的索引 + deleteUserConnPoolElement(w.userId, w.guestId, oldUniqueId) //添加用户id级别索引 createUserConnPoolElement(w.userId, w.guestId, wid) rsp := w.respondDataFormat(constants.WEBSOCKET_CONNECT_SUCCESS, wid)