Add tcp.Listener (#15)

* begin reviewing TCP listener

* begin adding listener tests

* adding TestExchange implementation

* split out legacy and Step tests

* move listener to tcp package

* fix up tcp tests taking very long

* add xnet.TCPPool and work on TCPPool semantics

* xnet: TCPPool only accepts established connections

* xnet: getting to bottom of panic in xnet.Listener

* xnet: improve listener tests

* fix several data races in testing fixtures

* fix more synchronization things in listener test

* finalize tcplistener test
This commit is contained in:
Pat Whittingslow
2026-01-03 12:41:57 -03:00
committed by GitHub
parent 5731a378dd
commit 018f9258ac
19 changed files with 2288 additions and 849 deletions
+2 -5
View File
@@ -27,8 +27,8 @@ func TestRingTx_op(t *testing.T) {
dataSent := make([]byte, 0, maxBuf*10)
var rtx ringTx
rng := rand.New(rand.NewSource(0))
for iseed := int64(0); iseed < 10000; iseed++ {
rng.Seed(iseed)
for iseed := int64(0); iseed < 1000; iseed++ {
rng.Seed(iseed + rng.Int63())
for itest := 0; itest < 32; itest++ {
bufsize := rng.Intn(maxBuf/2) + maxBuf/2
iss := Value(0)
@@ -209,9 +209,7 @@ func TestTxQueue_multipacket(t *testing.T) {
rng := rand.New(rand.NewSource(3))
var wbuf, rbuf [mtu]byte
for itest := 0; itest < 32; itest++ {
t.Log(itest)
rng.Seed(int64(itest))
println(itest)
err := rtx.Reset(internalbuff, maxPkts, iss)
if err != nil {
t.Fatal(err)
@@ -258,7 +256,6 @@ func TestTxQueue_multipacket(t *testing.T) {
}
acked := 0
for acked < roff {
t.Log(acked)
maxToack := min(roff-acked, maxWriteSize)
toack := rng.Intn(maxToack) + 1
// t.Log("\n", rtx.string())