简体   繁体   中英

Fastest way to transfer a file over UDP

What's the fastest way to send a file over UDP?
A) Create a large datagram for each chunk of the file, send that, and wait for a acknowledgement from the client before continuing
B) Create a large datagram for each chunk of the file, send multiple (numbered) datagrams, and wait for an acknowledgement that all sections were received, then continue the transfer. If some were not received with 5 seconds, re-transmit those parts
C) Some other method I'm not yet aware of

Practically anything I can think of in (C) will be miles faster than either of them. Neither of them uses windowing, so they can't use all the available bandwidth-delay product. (B) is in fact a very poor piece of protocol design.

By the time you have added all the required features to UDP you have TCP. Use TCP.

解决方案B比A快,但是解决方案C更快(更安全):尝试使用TCP而不是UDP

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