Skip to content

Add terminate_stream_to for receivers sent data by unicast - #90

Open
stewartadam wants to merge 1 commit into
mainfrom
claude/project-thread-0t11p6-7-terminate-stream-to
Open

stewartadam wants to merge 1 commit into
mainfrom
claude/project-thread-0t11p6-7-terminate-stream-to

Conversation

@stewartadam

@stewartadam stewartadam commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Problem

SacnSource::terminate_stream always sends its three Stream_Terminated packets to the universe's multicast group. If a receiver gets the universe's data by unicast and hasn't joined that group, it never sees the termination packets. It only drops the source after the 2.5 s network data loss timeout, instead of right away.

Change

New SacnSource::terminate_stream_to(universe, start_code, dst_ips: &[SocketAddr]):

  • sends E131_TERMINATE_STREAM_PACKET_COUNT termination packets to each destination, then deregisters the universe, just like terminate_stream;
  • if a send to one destination fails, still tries the rest, still deregisters, and returns the first error;
  • behaves exactly like terminate_stream (multicast) when dst_ips is empty.

terminate_stream and the Drop cleanup are unchanged.

Test

test_terminate_stream_to_reaches_unicast_receiver in tests/src_tests.rs sets up a unicast-only receiver, with multicast disabled so it doesn't join universe 1's group. It sends data by unicast, terminates with terminate_stream_to, and expects UniverseTerminated from the right CID. I also ran the same test with terminate_stream swapped in: the receiver times out without hearing the termination, which is the bug. All of tests/src_tests.rs passes.

terminate_stream only sends the termination packets to the universe's
multicast group, so a receiver that was sent the data by unicast and
hasn't joined the group never sees them and only drops the source after
the 2.5 s data loss timeout. terminate_stream_to sends the termination
packets to each given unicast destination, then deregisters the universe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KzaQVPkrkczgX2g7wGkip5
@stewartadam stewartadam self-assigned this Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants