diff --git a/internal/msg_gateway/gate/ws_server.go b/internal/msg_gateway/gate/ws_server.go index 6f913442c..1a832facf 100644 --- a/internal/msg_gateway/gate/ws_server.go +++ b/internal/msg_gateway/gate/ws_server.go @@ -259,7 +259,11 @@ func (ws *WServer) getSingleUserAllConn(uid string) map[string]*UserConn { rwLock.RLock() defer rwLock.RUnlock() if connMap, ok := ws.wsUserToConn[uid]; ok { - return connMap + newConnMap := make(map[int]*UserConn) + for k, v := range connMap { + newConnMap[k] = v + } + return newConnMap } return nil }