user3717061
user3717061

Reputation: 89

about the implement of the timeout retransmission mechanism based on UDP with java

Udp has not timeout retransmission, and does not guarantee that an orderly, but I need to use it now, I search the TCP related information, I found that the TCP seems to be sent to each data timing, if time also did not respond to resend the missing package. But this will provide timing for each datagram methods won't consume resources? you need a new a lot of timer, or do a timer timing scan all have observation is an already timeout needs to send datagrams retransmission

Upvotes: 1

Views: 509

Answers (1)

Germann Arlington
Germann Arlington

Reputation: 3353

UDP is unreliable http://en.wikipedia.org/wiki/User_Datagram_Protocol
It does not guarantee even delivery not only the sequence.
Simplistic way (that I implemented some time ago) was to generate a sequence number and include it in UDP packet.
Once the transmission is completed the recipient(s) were required to confirm start and end sequence packets received and any missing sequence packets (for retransmission), the implementation was based on lots of assumptions, but it was simple. lightweight and it worked.

Upvotes: 1

Related Questions