tcpHandler looks rounded off, add to example

This commit is contained in:
soypat
2025-02-10 20:26:02 -03:00
parent 64a7102064
commit 0cb43c47a4
10 changed files with 184 additions and 137 deletions
+4 -4
View File
@@ -26,12 +26,12 @@ func (tcb *ControlBlock) HelperExchange(t *testing.T, exchange []Exchange) {
if t.Failed() {
t.Errorf("exchange failed:\nwant: %s\ngot: %s",
ex.RFC9293String(ex.WantState, ex.WantPeerState),
ex.RFC9293String(tcb.state, ex.WantPeerState),
ex.RFC9293String(tcb._state, ex.WantPeerState),
)
}
}()
const pfx = "exchange"
t.Log(tcb.state, "Exchange start")
t.Log(tcb._state, "Exchange start")
for i, ex = range exchange {
if ex.Outgoing != nil && ex.Incoming != nil {
t.Fatalf(pfx+"[%d] cannot send and receive in the same exchange, please split into two exchanges.", i)
@@ -60,7 +60,7 @@ func (tcb *ControlBlock) HelperExchange(t *testing.T, exchange []Exchange) {
}
}
t.Log(ex.RFC9293String(tcb.state, ex.WantPeerState))
t.Log(ex.RFC9293String(tcb._state, ex.WantPeerState))
state := tcb.State()
if state != ex.WantState {
@@ -78,7 +78,7 @@ func (tcb *ControlBlock) HelperExchange(t *testing.T, exchange []Exchange) {
}
func (tcb *ControlBlock) HelperInitState(state State, localISS, localNXT Value, localWindow Size) {
tcb.state = state
tcb._state = state
tcb.snd = sendSpace{
ISS: localISS,
UNA: localISS,