feat: use UDP to publish/listen for speaker notes #419
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 is a followup to #389 that uses UDP sockets and loopback broadcast addresses to publish and listen for speaker notes. The previous solution using
iceoryx2
was using shared memory to communicate between differentpresenterm
instances. This is fine but was causing a couple of issues:Vec
s) which could cause future evolutions of this solution to require hacky workarounds.This new solution instead uses JSON over UDP sockets. Note that nothing internally in how speaker notes are parsed/managed has changed, it's just the communication protocol that did. This works like this:
127.255.255.255:<some port>
).SO_REUSEADDR
to allow multiple listeners on the same port as otherwise each packet goes to a single listener.Events sent contain the full presentation path so this allows having multiple publishers and listeners using different presentations but listening on the same port. This is the equivalent of the service name we had before.
As part of this I also changed the CLI parameters to be
--publish-speaker-notes
and--listen-speaker-notes
as they're a bit shorter. Also I added aspeaker_notes.always_publish
configuration parameter that causes the tool to always publish speaker notes unless you're running in listen mode.cc @dmackdev sorry this undoes some of the code you wrote but this was causing a few issues (see above). I really appreciate the effort you put into implementing this as the issue had been open for a long time and the solution you came up with was very simple and effective!