udp #5
@ -203,7 +203,7 @@ func (c *NewReno) AwaitEarlyUpdate(keepalive time.Duration) uint32 {
|
||||
c.updateAckNack()
|
||||
|
||||
// CASE 1: > 5 waiting ACKs or any waiting NACKs and no message sent in the last RTT
|
||||
if ((c.lastAck!=c.ack) || (c.lastNack != c.nack)) && time.Now().After(c.lastSent.Add(rtt)) {
|
||||
if ((c.lastAck != c.ack) || (c.lastNack != c.nack)) && time.Now().After(c.lastSent.Add(rtt)) {
|
||||
return 0
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,9 @@
|
||||
package congestion
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
type None struct {
|
||||
sequence chan uint32
|
||||
@ -27,17 +30,16 @@ func NewNone() *None {
|
||||
return &c
|
||||
}
|
||||
|
||||
func (c *None) Sequence() uint32 {
|
||||
return <-c.sequence
|
||||
func (c *None) String() string {
|
||||
return fmt.Sprintf("{None}")
|
||||
}
|
||||
|
||||
func (c *None) ReceivedPacket(uint32) {}
|
||||
func (c *None) ReceivedAck(uint32) {}
|
||||
func (c *None) NextAck() uint32 { return 0 }
|
||||
func (c *None) ReceivedNack(uint32) {}
|
||||
func (c *None) NextNack() uint32 { return 0 }
|
||||
func (c *None) AwaitEarlyUpdate(time.Duration) uint32 {
|
||||
select {}
|
||||
}
|
||||
func (c *None) AwaitAck(time.Duration) bool { return true }
|
||||
func (c *None) Reset() {}
|
||||
func (c *None) ReceivedPacket(uint32) {}
|
||||
func (c *None) ReceivedAck(uint32) {}
|
||||
func (c *None) ReceivedNack(uint32) {}
|
||||
func (c *None) Reset() {}
|
||||
func (c *None) AwaitAck(time.Duration) bool { return true }
|
||||
func (c *None) NextNack() uint32 { return 0 }
|
||||
func (c *None) NextAck() uint32 { return 0 }
|
||||
func (c *None) AwaitEarlyUpdate(time.Duration) uint32 { select {} }
|
||||
func (c *None) Sequence() uint32 { return <-c.sequence }
|
||||
|
Loading…
Reference in New Issue
Block a user