1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 11:07:40 +08:00

fix timeout.

This commit is contained in:
Mrs4s 2021-04-11 17:51:02 +08:00
parent 132dc119bf
commit 584cce937b

View File

@ -59,7 +59,7 @@ func (t *TCPListener) ReadBytes(len int) ([]byte, error) {
buf := make([]byte, len) buf := make([]byte, len)
_, err := io.ReadFull(t.conn, buf) _, err := io.ReadFull(t.conn, buf)
if err != nil { if err != nil {
time.Sleep(time.Millisecond * 500) // 服务器会发送offline包后立即断开连接, 此时还没解析, 可能还是得加锁 time.Sleep(time.Millisecond * 100) // 服务器会发送offline包后立即断开连接, 此时还没解析, 可能还是得加锁
if t.conn != nil { if t.conn != nil {
t.close() t.close()
t.invokeUnexpectedDisconnect(err) t.invokeUnexpectedDisconnect(err)