diff --git a/packet-queue.go b/packet-queue.go index d351f29..21d50a8 100644 --- a/packet-queue.go +++ b/packet-queue.go @@ -69,7 +69,7 @@ func NewPacketQueue(connection net.Conn) *PacketQueue { } 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 { if time.Since(start) > timeToWait { @@ -83,6 +83,6 @@ func (p *PacketQueue) Expect(messageType uint16, timeToWait time.Duration) (*Pac } } p.mu.RUnlock() - time.Sleep(time.Millisecond * 5) + time.Sleep(time.Millisecond * 2) } }