本地主机上 UDP 的可靠性 [英] Reliability of UDP on localhost

查看:33
本文介绍了本地主机上 UDP 的可靠性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 UDP 本质上是不可靠的,但是当连接到 localhost 时,我希望内核以不同的方式处理连接,因为一切都可以在内部处理.那么在这种特殊情况下,UDP 是否被认为是一种可靠的协议,或者如果缓冲区溢出,内核仍然可能会丢弃一些数据包?

I know that UDP is inherently unreliable, but when connecting to localhost I would expect the kernel handles the connection differently since everything can be handled internally. So in this special case, is UDP considered a reliable protocol, or will the kernel still potentially junk some packets if buffers are overrun?

推荐答案

我重复一个 相关问题的上一个答案.为了保持便携性,请始终预计您的 UDP 套接字可能会丢弃数据包或接收乱序数据.

I repeat a previous answer to a related question. To remain portable always anticipate your UDP sockets might drop packets or receive out of order data.

这篇关于本地主机上 UDP 的可靠性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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