Reliability of UDP on localhost

2019-02-16 14:59发布

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 kernel
3条回答
欢心
2楼-- · 2019-02-16 15:39

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.

查看更多
Rolldiameter
3楼-- · 2019-02-16 15:40

I don't think that UDP (or any other network protocol) says anything about different behavior when connecting to localhost. So the answer will depend on the specific kernel that you're using. Best to assume that UDP will behave like UDP.

查看更多
我只想做你的唯一
4楼-- · 2019-02-16 15:41

I have seen UDP to localhost dropping packets. We think we were overloading the kernel queue. All we know for sure is that it was dropping packets.

查看更多
登录 后发表回答