简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM