This commit is contained in:
esrrhs 2019-10-26 17:08:06 +08:00
parent ba76acaf87
commit 2ed5548a6f
2 changed files with 8 additions and 0 deletions

View File

@ -262,6 +262,8 @@ func (p *Client) AcceptTcpConn(conn *net.TCPConn) {
p.sendPacket++
p.sendPacketSize += (uint64)(len(mb))
}
} else {
time.Sleep(time.Millisecond * 10)
}
if clientConn.fm.GetRecvBufferSize() > 0 {
@ -280,6 +282,8 @@ func (p *Client) AcceptTcpConn(conn *net.TCPConn) {
clientConn.fm.SkipRecvBuffer(n)
tcpActiveSendTime = now
}
} else {
time.Sleep(time.Millisecond * 10)
}
diffrecv := now.Sub(clientConn.activeRecvTime)

View File

@ -227,6 +227,8 @@ func (p *Server) RecvTCP(conn *ServerConn, id string, src *net.IPAddr) {
p.sendPacket++
p.sendPacketSize += (uint64)(len(mb))
}
} else {
time.Sleep(time.Millisecond * 10)
}
if conn.fm.GetRecvBufferSize() > 0 {
@ -245,6 +247,8 @@ func (p *Server) RecvTCP(conn *ServerConn, id string, src *net.IPAddr) {
conn.fm.SkipRecvBuffer(n)
tcpActiveSendTime = now
}
} else {
time.Sleep(time.Millisecond * 10)
}
diffrecv := now.Sub(conn.activeRecvTime)