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()