0

UDP 受信者が同じパケットを 2 回受信するのはなぜですか? UDP送信者は受信者に1つのパケットを送信するだけですが、受信者はパケットを2回受信し、2つのパケットは同じです.送信者と受信者は異なるデバイスで実行されます.送信者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 に答える