TCP Server refactoring #488

Closed
muellerr wants to merge 16 commits from eive:mueller/tcp-keep-open-pr into development
Owner

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

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
muellerr added 2 commits 2021-09-28 15:11:21 +02:00
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 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 way.
muellerr changed title from TCP refactoring to WIP: TCP refactoring 2021-09-28 15:11:27 +02:00
muellerr added 1 commit 2021-09-28 15:13:04 +02:00
muellerr added 1 commit 2021-09-28 15:13:59 +02:00
muellerr changed title from WIP: TCP refactoring to WIP: TCP Server refactoring 2021-09-28 15:14:48 +02:00
muellerr added 1 commit 2021-09-28 15:30:15 +02:00
muellerr added 1 commit 2021-09-28 15:33:39 +02:00
muellerr added 2 commits 2021-09-28 16:34:01 +02:00
muellerr added 2 commits 2021-09-28 17:35:20 +02:00
muellerr added 1 commit 2021-09-28 17:39:18 +02:00
muellerr added 1 commit 2021-09-28 17:42:44 +02:00
muellerr requested review from gaisser 2021-09-28 18:00:28 +02:00
muellerr changed title from WIP: TCP Server refactoring to TCP Server refactoring 2021-09-28 18:00:34 +02:00
muellerr added the
Refactor
feature
labels 2021-09-28 18:07:11 +02:00
muellerr added 1 commit 2021-09-29 11:45:30 +02:00
muellerr added 1 commit 2021-09-29 16:16:29 +02:00
muellerr added 1 commit 2021-10-04 14:41:56 +02:00
muellerr added this to the v3.0.0 milestone 2021-10-05 12:32:20 +02:00
muellerr added 1 commit 2021-10-05 18:27:32 +02:00
muellerr closed this pull request 2021-10-06 17:45:18 +02:00
gaisser removed this from the v3.0.0 milestone 2021-11-15 14:21:05 +01:00

Pull request closed

Sign in to join this conversation.
No description provided.