linux - 在短缺时间缓冲 UDP 数据包
问题描述
我的情况是Linux客户端正在使用UDP Socket。客户端正在发送消息,如果 10 秒内没有响应,客户端将每隔 10 秒重试一次。
情况是当连接断开时,客户端发送了许多试验,同时服务器端没有收到任何内容。连接建立后,我发现服务器上同时收到所有先前的消息,这意味着它已被缓冲,并且由于服务器端同一时刻收到的重复消息而导致很多问题。
客户端上的 TCPDUMP:
21:01:14.691903 IP 172.123.13211 > 172.34.13211: length 88 "1st at second 14"
21:01:24.692791 IP 172.123.13211 > 172.34.13211: length 88 "2nd at second 24"
21:01:34.694930 IP 172.123.13211 > 172.34.13211: length 88 "3rd at second 34"
21:01:44.696020 IP 172.123.13211 > 172.34.13211: length 88 "4th ate second 44"
连接建立后服务器 TCPDUMP:
12:02:01.509518 IP 172.123.13211 > 13211: length 88 "Received 1st at second 1"
12:02:01.517841 IP 172.123.13211 > 13211: length 88 "Received 2nd at second 1"
12:02:01.543759 IP 172.123.13211 > 13211 length 88 "Received 3rd at second 1"
12:02:01.550741 IP 13211 > 172.123.13211: length 36
12:02:01.567948 IP 172.123.13211 > .13211: length 88
我需要了解使用 UDP 套接字并且 Connection is down 的情况。如何避免在短缺期间缓冲数据包
客户端代码是 C++ 谢谢
解决方案
推荐阅读
- git - 在 bitrise 的 CI / CD 工作流程期间,使用单个 SSH 密钥访问 2 个不同的私有 git 存储库
- excel - VBA,FOR LOOP,IF语句,获取前一个单元格的值
- angular - 为自定义后端 api 扩展 spartacus occmodule 的最佳方式
- firebase - 致命错误:索引超出范围,同时在 SwiftUI 的列表中从 Firebase 中删除项目
- cloud - Spring Cloug 配置客户端不从配置服务器获取属性
- elasticsearch - 错误 io_tls flb_io_tls.c:359 NET - 连接已被对等方重置
- css - css网格交替行颜色并放置一个box-shadow
- .htaccess - .htaccess URL 使用 domain.de?user=test 重写 domain.de/test
- json - 当文件中有其他对象时,合并两个具有公共键值的 JSON 文件
- express - 如何使用 node-fetch 转发多部分表单请求