UDP套接字缓冲区溢出检测 [英] UDP socket buffer overflow detection

查看:1325
本文介绍了UDP套接字缓冲区溢出检测的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发跨平台工具,捕捉各种比特率的多个UDP流。
提高:: ASIO用于联网。有什么方法来检测的情况时,UDP缓冲区已满,在插座数据丢失可能发生?我现在可以看到的唯一方法是阅读的/ proc / PID%%/网/ UDP,但你知道这不是aplicable窗户:)。另外,我想如果可能的话使用boost功能吧。

I'm developing cross-platform tool that captures multiple udp streams with various bit-rate. boost::asio is used for networking. Is there any way to detect the situation when the udp buffer was full and data loss on socket could take place? The only way I can see now is reading /proc/%pid%/net/udp, but it's not aplicable for windows as you know :). Also I'd like to use boost features for it if possible.

推荐答案

如果你需要这个功能,你必须code它变成您所使用的协议。 UDP是不能单独做这个的。例如,你可以把一个序列号中的每个数据报。丢失的数据包将对应缺少的序列号。

If you need this capability, you have to code it into the protocol you are using. UDP is incapable of doing this by itself. For example, you could put a sequence number in each datagram. Missing datagrams would correspond to missing sequence numbers.

这篇关于UDP套接字缓冲区溢出检测的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆