Commit d96e3c4
committed
refactor: improve code quality and add packet processing tests
- Convert iovec C-arrays to std::array<iovec, N> (4 sites in NUClearNet.cpp, 1 in header)
- Replace for(;;){break} in read_socket with while loop
- Split process_packet switch/case into if-else chain dispatching to per-type methods:
process_announce_packet, process_leave_packet, process_connect_packet,
process_data_packet, process_ack_packet
- Make per-type methods public for testability
- Add comprehensive behavioral tests (ProcessPacket.cpp) covering:
validate_header edge cases, packet dispatch, connect handshake,
data delivery/rejection/dedup/reassembly, ACK handling, send paths1 parent 89e3c38 commit d96e3c4
3 files changed
Lines changed: 661 additions & 179 deletions
0 commit comments