接收大量多播时单声道丢弃数据包
我正在创建一个通过多播收听视频流的程序。在 Linux 上使用 Mono 收听一个 feed 效果很好,但收听 15 个 feed 会丢包。在 Windows .NET 上运行代码不会丢失数据包,并且在 Linux 上使用 C 程序侦听源也不会丢失数据包。我可以做些什么来优化这个吗?
I am creating a program that listens to video streams over multicast. Listening to one feed with Mono on Linux works fine but listening to 15 feeds drops packets. Running the code on Windows .NET does not drop packets and listening to the feeds with a C program on Linux does not drop packets. Is there something I could do to optimize this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据您使用的机制(从代码角度来看),您可能无法足够快地捕获数据包。这将导致多播数据丢失,而多播数据本质上是不可靠的。
如果没有有关所采用机制的更多信息,很难为您提供任何更具体的建议。
根据评论进行更新:
如果每个接收器有一个线程,并且线程数多于 CPU,则可能会过度订阅线程,从而导致大量昂贵的上下文切换。这可能会导致丢包。
Depending on what mechanism you use, code wise, you may not be capturing the packets fast enough. That would result in drops of multicast data, which by its very nature is unreliable.
Without more info about the mechanism employed, it's difficult to give you any more specific advice.
Update based on comments:
If you have a thread per receiver and more threads than CPUs, you may be oversubscribing your threads, causing a lot of expensive context switching. This could lead to dropped packets.