fix
This commit is contained in:
parent
35eb087b5a
commit
998975e413
|
@ -200,9 +200,7 @@ func (l *DataTransferLogic) setConnPool(conn *websocket.Conn, userInfo *auth.Use
|
|||
//保存连接
|
||||
mapConnPool.Store(uniqueId, ws)
|
||||
//非白板用户,需要为这个用户建立map索引便于通过用户查询
|
||||
if userInfo.IsUser() || userInfo.IsGuest() {
|
||||
createUserConnPoolElement(userInfo.UserId, userInfo.GuestId, uniqueId)
|
||||
}
|
||||
if isFirefoxBrowser {
|
||||
time.Sleep(time.Second * 1) //兼容下火狐(直接发回去收不到第一条消息:有待研究)
|
||||
}
|
||||
|
|
|
@ -16,6 +16,9 @@ var (
|
|||
|
||||
// 添加用户索引池ws连接
|
||||
func createUserConnPoolElement(userId, guestId int64, uniqueId string) {
|
||||
if userId == 0 && guestId == 0 {
|
||||
return
|
||||
}
|
||||
data := userConnPoolCtlChanItem{
|
||||
userId: userId,
|
||||
guestId: guestId,
|
||||
|
@ -34,6 +37,9 @@ func createUserConnPoolElement(userId, guestId int64, uniqueId string) {
|
|||
|
||||
// 从用户索引池删除ws连接
|
||||
func deleteUserConnPoolElement(userId, guestId int64, uniqueId string) {
|
||||
if userId == 0 && guestId == 0 {
|
||||
return
|
||||
}
|
||||
data := userConnPoolCtlChanItem{
|
||||
userId: userId,
|
||||
guestId: guestId,
|
||||
|
|
Loading…
Reference in New Issue
Block a user