更改设置心跳断线时机

This commit is contained in:
meixiongfeng 2023-01-30 17:31:52 +08:00
parent ec3610dc6e
commit d27ece2da0

View File

@ -70,7 +70,7 @@ locp:
go this.Close()
break locp
}
this.wsConn.SetReadDeadline(time.Now().Add(time.Second * 30))
if err = proto.Unmarshal(data, msg); err != nil {
this.gateway.Errorf("agent:%s uId:%s Unmarshal err:%v", this.sessionId, this.uId, err)
go this.Close()
@ -88,6 +88,7 @@ locp:
SubType: "heartbeat",
Data: data,
})
this.wsConn.SetReadDeadline(time.Now().Add(time.Second * 30))
continue
}
if err := this.messageDistribution(msg); err != nil {