From 132dc119bf4c96286371052229fbe1bf1899707b Mon Sep 17 00:00:00 2001 From: Mrs4s <1844812067@qq.com> Date: Sun, 11 Apr 2021 17:06:02 +0800 Subject: [PATCH] fix timeout. --- utils/connection.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/connection.go b/utils/connection.go index 5648161a..e07ab17c 100644 --- a/utils/connection.go +++ b/utils/connection.go @@ -59,7 +59,7 @@ func (t *TCPListener) ReadBytes(len int) ([]byte, error) { buf := make([]byte, len) _, err := io.ReadFull(t.conn, buf) if err != nil { - time.Sleep(time.Millisecond * 100) // 服务器会发送offline包后立即断开连接, 此时还没解析 + time.Sleep(time.Millisecond * 500) // 服务器会发送offline包后立即断开连接, 此时还没解析, 可能还是得加锁 if t.conn != nil { t.close() t.invokeUnexpectedDisconnect(err)