Ack Cut 1c (C#): a Connect's sequence says whether it repeats; the handshake alone seeds the watermark
The session records the sequence of the Connect that started its generation. A Connect repeats exactly when the session is connected and carries that sequence; anything else ends the generation, forgets the peer and accepts a new one. AcceptConnect answers both, ConnectRepeats is the predicate for servers that keep one session per peer, and AnswerRepeatedConnect is private. Server mode admits a Connect from a new endpoint and the session decides; the listener no longer compares payloads (the payload stays application evidence). CreateConnect on a session that has had a peer starts a new generation. An Accept counts only while the Connect is pending and only if it names it. The watermark is seeded by the Connect or Accept alone; reliable data before that is neither remembered, acknowledged nor delivered. The default initial sequence is random in [1, 2^31) in every options type. An ICMP connection reset no longer sets DisconnectReason: nothing ended. The interop peer flushes before it disconnects. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
2e56b46656
commit
5ff1ee3222
5 changed files with 153 additions and 54 deletions
|
|
@ -909,7 +909,7 @@ namespace GameCult.Networking.Tests
|
|||
var accept = server.AcceptConnect(connect, 0);
|
||||
var repeat = CultNetRudpPacketCodec.Decode(CultNetRudpPacketCodec.Encode(connect));
|
||||
repeat.Ack = accept.Sequence;
|
||||
var reply = server.AnswerRepeatedConnect(repeat, 1);
|
||||
var reply = server.AcceptConnect(repeat, 1);
|
||||
Assert.That(reply.PacketType, Is.EqualTo(CultNetRudpPacketType.Ack));
|
||||
Assert.That(server.OutstandingReliablePacketCount, Is.EqualTo(0));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue