This commit is contained in:
laodaming 2023-09-04 14:44:35 +08:00
parent c518b5a68d
commit d1b2b24fcf

View File

@ -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)