diff --git a/modules/gateway/agent.go b/modules/gateway/agent.go index 7ca867f8f..430b8c0d1 100644 --- a/modules/gateway/agent.go +++ b/modules/gateway/agent.go @@ -79,6 +79,7 @@ locp: go this.Close() break locp } else { + this.wsConn.SetReadDeadline(time.Now().Add(time.Second * 60)) // this.gateway.Debugf("----------1 agent:%s uId:%s MainType:%s SubType:%s ", this.sessionId, this.uId, msg.MainType, msg.SubType) if msg.MainType == string(comm.ModuleGate) { //心跳消息 无需校验秘钥 data, _ := anypb.New(&pb.GatewayHeartbeatResp{ @@ -89,7 +90,6 @@ locp: SubType: "heartbeat", Data: data, }) - this.wsConn.SetReadDeadline(time.Now().Add(time.Second * 30)) continue } var code pb.ErrorCode