Skip to content

Forward data packets - #4096

Merged
boks1971 merged 6 commits into
raja_dtfrom
raja_dt_forward_data_packets
Nov 21, 2025
Merged

boks1971 merged 6 commits into
raja_dtfrom
raja_dt_forward_data_packets

Conversation

@boks1971

Copy link
Copy Markdown
Contributor

Next stop on data tracks support. This is set up to merge into my previous PR branch. This adds support for forwarding data track packets.

Some bits TODO:

  • data track packet tests
  • for some reason, the multi node scenario test does not receive all packets or receives packets after some unexplained delay, have to dig into this further. It is not consistent. So, has been a hard one to chase.

Will probably looking at getting this merged into the previous branch and into master to get minimal version of this feature out. Have to make cloud changes also to get this working across cloud. Will then iterate on it based on usage.

Comment thread pkg/rtc/datatrack.go
Comment on lines +130 to +132
if d.closed.IsBroken() {
return errReceiverClosed
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we have this check - just wanted to check if we have/need atomicity with the actions below in this function - would something bad happen if we check closed - we see it's not broken and proceed but then immediately fuse gets broken?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will think about it more.

It should be fine I think. The down track will get added, but when delete gets called, it should be cleaned up.

Comment thread pkg/rtc/datatrack.go Outdated
}

func (d *DataTrack) HandlePacket(data []byte, packet *datatrack.Packet) {
d.params.Logger.Infow("received data track message", "id", d.ID(), "name", d.Name(), "size", len(data))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just checking if you intentionally added info level logging on packet level?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it is intentional for initial debugging. But, will remove it before merging.

Comment thread test/client/datatrack_writer.go Outdated
}

var lastPacket datatrack.Packet
if err := lastPacket.Unmarshal(packets[len(packets)-1]); err == nil {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I see GenerateRawDataPackets can return nil in some corner cases - maybe we should guard this to avoid packets[len(packets)-1] in that case?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Will do.

@boks1971

Copy link
Copy Markdown
Contributor Author

Merging this to the other PR branch, thank you @milos-lk . If others do have comments, please add and I will address.

@boks1971
boks1971 merged commit 72e6e03 into raja_dt Nov 21, 2025
@boks1971
boks1971 deleted the raja_dt_forward_data_packets branch November 21, 2025 11:52
boks1971 added a commit that referenced this pull request Dec 4, 2025
* WIP

* WIP

* Starting to add some signalling integration testing.

* Working tests.

* fix tests

* Forward data packets (#4096)

* WIP commit

* WIP

* WIP

* fix forwarding

* address PR comments

* move some methods from LocalParticipant to Participant interface

* handle subscription update

* add extensions and tests

* more packet tests

* add test for replace extension and fix a bug

* update protocol and add config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants