Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When to call decoding, duplicated outputs #149

Closed
the-c0d3r opened this issue Jun 13, 2023 · 3 comments
Closed

When to call decoding, duplicated outputs #149

the-c0d3r opened this issue Jun 13, 2023 · 3 comments

Comments

@the-c0d3r
Copy link

Hi, I was using the python binding to encode streaming data before sending to the other side through a one directional link with UDP packets.

I was wondering when should I call the decode function. Assuming, I have a block of data (same size as MTU, 4000), then with 1 repair block (same size as MTU, 4000). Then if I transmit these two packets to the other side, when should I call the decode function, as I could have both packets, or in case of loss, I would only have one.

Packets are received one by one on the other side, so I need to know when to call the decode function and when to buffer the packets before calling decode. I found that if I call on every packet, then I will end up with duplicated data block, as the source packet and repair packet will lead to the same output.

Please enlighten me on the possible design for sending data through UDP packets.

@cberner
Copy link
Owner

cberner commented Jun 13, 2023

You should call it for each packet that arrives, and then stop calling it when you get a non-None output back

@the-c0d3r
Copy link
Author

the-c0d3r commented Jun 13, 2023 via email

@cberner
Copy link
Owner

cberner commented Jun 14, 2023

Take a look at the examples folder. You don't need to buffer all the packets, but you do need to check for None

@cberner cberner closed this as completed Jun 14, 2023
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

No branches or pull requests

2 participants