17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-28 18:07:29 +01:00

hardware protocol v2: make the hello handshake idempotent

A device which doesn't hear the welcome repeats its greeting. Minting a
fresh session for every repeat left both ends chasing each other's
session ids: the device eventually answered with the id it had been
given, the simulator had already moved on and rejected it as
INVALID_SESSION, the device restarted the handshake, and so on twice a
second for as long as the link was up.

The same greeting arriving on a session which has not been used yet is
now answered with the session it already has, and only a different
device, or one whose session had progressed, gets a new id. Repeated
greetings are counted as handshakes and shown in the debug panel, so the
condition which causes them stays visible instead of flooding the log.
This commit is contained in:
2026-09-17 15:01:58 +00:00
parent 63f322fa7b
commit 314595e8f0
3 changed files with 44 additions and 10 deletions

View File

@@ -1393,7 +1393,8 @@ debug_panel::update_section_hardware( std::vector<text_line> &Output ) {
+ " symbol " + std::to_string( protocol.unknown_symbols )
+ " handle " + std::to_string( protocol.unknown_handles )
+ " duplicates " + std::to_string( protocol.duplicate_commands )
+ " rate limited " + std::to_string( protocol.rate_limited );
+ " rate limited " + std::to_string( protocol.rate_limited )
+ " handshakes " + std::to_string( protocol.handshakes );
textline +=
"\nack " + std::to_string( protocol.acks )