user conn map copy

pull/351/head
Gordon 2 years ago
parent d622f1df3d
commit 15ef064fc3

@ -368,7 +368,11 @@ func (ws *WServer) getUserAllCons(uid string) map[int]*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
}

Loading…
Cancel
Save