This commit is contained in:
@@ -69,7 +69,7 @@ func NewPacketQueue(connection net.Conn) *PacketQueue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *PacketQueue) Expect(messageType uint16, timeToWait time.Duration) (*PacketWithData, error) {
|
func (p *PacketQueue) Expect(messageType uint16, timeToWait time.Duration) (*PacketWithData, error) {
|
||||||
start := time.Now().Add(-time.Millisecond * 5)
|
start := time.Now().Add(-time.Millisecond)
|
||||||
|
|
||||||
for {
|
for {
|
||||||
if time.Since(start) > timeToWait {
|
if time.Since(start) > timeToWait {
|
||||||
@@ -83,6 +83,6 @@ func (p *PacketQueue) Expect(messageType uint16, timeToWait time.Duration) (*Pac
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
p.mu.RUnlock()
|
p.mu.RUnlock()
|
||||||
time.Sleep(time.Millisecond * 5)
|
time.Sleep(time.Millisecond * 2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user