udp丢包和恢复
我正在开发基于 udp/tcp 的 P2P 文件和实时视频流应用程序。该应用程序将使用 C++ 为 Linux 和 Windows 平台开发。
我们使用ICE(TCP/UDP打洞)来实现P2P。 虽然 TCP 确保数据包丢失,但对于 UDP,我需要一种合适的方法来确保数据包必须传递到另一个对等点。
- 我想知道执行此操作的算法或技术。
- 有没有免费的第三方工具/库可以做。
任何链接和建议将不胜感激?
I am working on both udp/tcp based P2P for file and real time video streaming application.the application will be developed for both Linux and windows platform using c++.
We are using ICE(TCP/UDP hole punching) to implement the P2P.
while TCP ensure the packet loss but for UDP I need a decent approach to make sure packet must be delivered to the other peer.
- I wanted to know the algorithm or technique to do this.
- Is there any free thord party tool/libraries to do.
Any link and suggestion will be appreciated?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要解决 4 个主要问题:
您可以实现一个名为切片窗口的协议。我认为您不会为此找到第 3 方库(尽管有人可能会在这里证明我是错的),因为以上所有内容通常都是由 TCP 本身实现的。
You need to cover for 4 main issues:
There is a protocol called slicing window which you could implement. I don't think you'll find a 3rd party library for this (though someone may prove me wrong here), because all the above is typically implemented by TCP itself.
您可能会发现此问题的答案很有帮助:您使用什么什么时候需要可靠的UDP?
You might find the answers to this question helpful: What do you use when you need reliable UDP?
一种简单的方法是为每个数据包设置一个监视线程——
如果性能很重要,则可以使用单个线程来监视消息队列。
A simple approach would be to have a monitoring thread for each packet --
If performance is important, a single thread could be used to monitor a queue of messages.