TCP Server refactoring #488
No reviewers
Labels
No Label
API Change
Breaking API Change
bug
build
cosmetics
Documentation
duplicate
feature
help wanted
hotfix
invalid
question
Refactor
Tests
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: fsfw/fsfw#488
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "eive:mueller/tcp-keep-open-pr"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #470
This refactoring keeps the TCP connection opened until the client closes
it. It also increased the robustness of the TCP reception.
Because TCP is stream based and usually applied to newline separated
data, a special way to handle binary space packets is required.
The new SpacePacketParser class takes care of this by taking TC packet
IDs as optional start markers to parse for space packets in a given
buffer.
The refactored TCP server uses a ring buffer, a reception buffer and the
new parser to extract space packets from a stream in a safer and more robust way.
If the server is idle, it will use a configurable delay to decrease the CPU load.
A new reception mode state was introduced which could be used in the future to support newline separated data or other packet formats.
The changes were tested on Embedded Linux, Desktop Linux and Desktop Windows.
Unit tests for the new parser will follow in a separate PR
TCP refactoringto WIP: TCP refactoringWIP: TCP refactoringto WIP: TCP Server refactoringWIP: TCP Server refactoringto TCP Server refactoringPull request closed