From 58e8c9002d67f625b45045aa1e42a73464e99802 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 18 Aug 2022 10:32:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0socket=20=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E8=B6=85=E6=97=B6=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/gateway/agent.go | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/gateway/agent.go b/modules/gateway/agent.go index dd533764a..a83cfd675 100644 --- a/modules/gateway/agent.go +++ b/modules/gateway/agent.go @@ -36,6 +36,7 @@ func newAgent(gateway IGateway, conn *websocket.Conn) *Agent { closeSignal: make(chan bool), state: 1, } + conn.SetReadDeadline(time.Now().Add(time.Minute)) //一分钟内不登录 自动断开连接 agent.wg.Add(2) go agent.readLoop() go agent.writeLoop()