修改websocket bug
This commit is contained in:
parent
deeeacd6ac
commit
a2ecd518aa
@ -24,5 +24,6 @@ func (s *ClientService) onLogin(cMsg *pb.ClientMsg, msg *pb.S2CUserLogin) {
|
|||||||
}
|
}
|
||||||
_ = cMsg
|
_ = cMsg
|
||||||
s.userId = msg.UserId
|
s.userId = msg.UserId
|
||||||
|
s.client.SetUid(msg.UserId)
|
||||||
log.DebugF("user:%v id:%v login success", s.username, msg.UserId)
|
log.DebugF("user:%v id:%v login success", s.username, msg.UserId)
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ func newClientService(serviceId int) *ClientService {
|
|||||||
|
|
||||||
func (s *ClientService) loopLoginHour() {
|
func (s *ClientService) loopLoginHour() {
|
||||||
s.login()
|
s.login()
|
||||||
time.AfterFunc(time.Hour, s.loopLoginHour)
|
time.AfterFunc(5*time.Minute, s.loopLoginHour)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ClientService) OnInit() {
|
func (s *ClientService) OnInit() {
|
||||||
|
@ -47,5 +47,5 @@ func (s *GateService) onUserLogout(iMsg *ipb.InternalMsg, conn ws.IConn, msg *pb
|
|||||||
}
|
}
|
||||||
s.SendClientMsg(conn, iMsg.ServiceName, int32(pb.MsgId_S2CUserLogoutId), msg)
|
s.SendClientMsg(conn, iMsg.ServiceName, int32(pb.MsgId_S2CUserLogoutId), msg)
|
||||||
// 登出的清理工作由WsOnDisconnect实现
|
// 登出的清理工作由WsOnDisconnect实现
|
||||||
conn.NotifyClose()
|
conn.Close()
|
||||||
}
|
}
|
||||||
|
4
工作.txt
4
工作.txt
@ -1,6 +1,6 @@
|
|||||||
1.测试gate
|
1.测试gate
|
||||||
1.1 每10分钟新起1000个连接,发送登陆,然后关闭。检查是否有内存及协程泄漏。
|
1.1 每10分钟新起1000个连接,发送登陆,然后关闭。检查是否有内存及协程泄漏。(有泄漏)
|
||||||
1.2 启动1000个链接,每小时固定发送登陆消息,一天后查看连接是否还在。检查心跳机制。
|
1.2 启动1000个链接,每小时固定发送登陆消息,一天后查看连接是否还在。检查心跳机制。(已修复)
|
||||||
|
|
||||||
2.编写db服
|
2.编写db服
|
||||||
2.1 login服向db服请求数据及向log db服写入日志。测试rpc机制。
|
2.1 login服向db服请求数据及向log db服写入日志。测试rpc机制。
|
||||||
|
Loading…
x
Reference in New Issue
Block a user