lneto rework: Require explicit BackoffStrategy in all APIs (#116)

* make backoff explicit API

* fix tests to use explicit backoff

* fix examples with explicit tcp
This commit is contained in:
Pat Whittingslow
2026-06-09 10:20:40 -03:00
committed by GitHub
parent 3b82cefec3
commit 6ba06acdcb
28 changed files with 324 additions and 84 deletions
+6
View File
@@ -208,6 +208,7 @@ func newTCPStacks(t testing.TB, randSeed int64, mtu int) (s1, s2 *StackAsync, c1
RxBuf: buf[:mtu],
TxBuf: buf[mtu : mtu*2],
TxPacketQueueSize: 4,
RWBackoff: backoffYield,
})
if err != nil {
t.Fatal(err)
@@ -216,6 +217,7 @@ func newTCPStacks(t testing.TB, randSeed int64, mtu int) (s1, s2 *StackAsync, c1
RxBuf: buf[2*mtu : 3*mtu],
TxBuf: buf[3*mtu : 4*mtu],
TxPacketQueueSize: 4,
RWBackoff: backoffYield,
})
if err != nil {
t.Fatal(err)
@@ -1045,3 +1047,7 @@ func getTCPFrame(etherFrame []byte) (tcp.Frame, bool) {
}
return tfrm, true
}
func backoffYield(consecutiveBackoffs uint) time.Duration {
return lneto.BackoffFlagGosched
}