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
+3
View File
@@ -5,6 +5,7 @@ import (
"net/netip"
"testing"
"github.com/soypat/lneto"
"github.com/soypat/lneto/ethernet"
"github.com/soypat/lneto/ipv4"
"github.com/soypat/lneto/tcp"
@@ -73,6 +74,7 @@ func TestStackAsync_ListenerSynAckAddressedToClient(t *testing.T) {
RxBufSize: mtu,
EstablishedTimeout: 10e9,
ClosingTimeout: 10e9,
NewBackoff: func() lneto.BackoffStrategy { return backoffYield },
})
if err != nil {
t.Fatal(err)
@@ -104,6 +106,7 @@ func TestStackAsync_ListenerSynAckAddressedToClient(t *testing.T) {
if err = clConn.Configure(tcp.ConnConfig{
RxBuf: make([]byte, mtu), TxBuf: make([]byte, mtu),
TxPacketQueueSize: 4,
RWBackoff: backoffYield,
}); err != nil {
t.Fatal(err)
}