0

为什么 UDP 接收者两次收到同一个数据包?UDP发送方只向接收方发送一个数据包,但接收方两次收到数据包,两个数据包相同。发送方和接收方运行在不同的设备中。发送方APP运行在android设备中,接收方是在 iOS 设备中运行。如何解释这种情况以及如何解决?

4

1 回答 1

2

http://en.wikipedia.org/wiki/User_Datagram_Protocol

UDP uses a simple transmission model with a minimum of protocol mechanism.
It has no handshaking dialogues, and thus exposes any unreliability of the
underlying network protocol to the user's program. As this is normally IP
over unreliable media, there is no guarantee of delivery, ordering or
duplicate protection.

如果要避免这种情况,则必须改用 TCP。

于 2012-09-19T13:57:16.777 回答