Network stability pass #36
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements and refactors to the networking code, focusing on packet handling, debugging, and the client-server protocol. The most significant changes are the introduction of more granular packet counters for both host and peer targets, enhanced debugging options, and a refactor of the packet reordering and caching mechanisms to support these changes. These updates improve the clarity, flexibility, and robustness of the networking stack.
Networking Protocol and Client Refactor:
Targetsenum toClient, allowing separate tracking of packet counters and reordered counters forPEERandHOST, and refactored related methods and member variables to use these new counters. This enables more precise packet tracking and management. [1] [2] [3]PacketReordererand related protocol logic to use the new reordered counter, including changes to method signatures and member variables, ensuring correct handling and ordering of packets per target. [1] [2] [3]ProtocolPacketto replace the concept of "last counter" with "reordered counter" throughout, aligning with the new tracking system. [1] [2] [3] [4] [5] [6]Debugging and Build Options:
FGE_ENABLE_PACKET_DEBUG_VERBOSEto enable verbose packet debug printing, with a warning if enabled without debug mode. [1] [2]Packet Cache and Reordering Improvements:
PacketCachewith an alarm state, a new processing method, and internal refactoring for better packet retransmission and tracking. [1] [2] [3] [4]API and Example Updates:
Packetclass with proper assignment operators and minor cleanups.Other Protocol and Infrastructure Changes:
NetFluxUdpin the protocol header to support new method signatures.These changes collectively modernize the networking internals, making the system more maintainable and robust for future development.