mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 19:17:38 +08:00
fix timeout.
This commit is contained in:
parent
7dd453267d
commit
132dc119bf
@ -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 * 100) // 服务器会发送offline包后立即断开连接, 此时还没解析
|
time.Sleep(time.Millisecond * 500) // 服务器会发送offline包后立即断开连接, 此时还没解析, 可能还是得加锁
|
||||||
if t.conn != nil {
|
if t.conn != nil {
|
||||||
t.close()
|
t.close()
|
||||||
t.invokeUnexpectedDisconnect(err)
|
t.invokeUnexpectedDisconnect(err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user