From d27ece2da090fa3e41633fe0d3e81d27490a9990 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Mon, 30 Jan 2023 17:31:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E8=AE=BE=E7=BD=AE=E5=BF=83?= =?UTF-8?q?=E8=B7=B3=E6=96=AD=E7=BA=BF=E6=97=B6=E6=9C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/gateway/agent.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/gateway/agent.go b/modules/gateway/agent.go index 41ab6dd4e..5481a5aa3 100644 --- a/modules/gateway/agent.go +++ b/modules/gateway/agent.go @@ -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 {