简体   繁体   English

通过UDP传输文件的最快方法

[英]Fastest way to transfer a file over UDP

What's the fastest way to send a file over UDP? 通过UDP发送文件的最快方法是什么?
A) Create a large datagram for each chunk of the file, send that, and wait for a acknowledgement from the client before continuing A)为文件的每个块创建一个大数据报,发送该数据报,并在继续之前等待客户端的确认
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. B)为文件的每个块创建一个较大的数据报,发送多个(编号)数据报,并等待确认已收到所有节,然后继续传输。 If some were not received with 5 seconds, re-transmit those parts 如果5秒钟后仍未收到,请重新发送这些部分
C) Some other method I'm not yet aware of C)我还不知道的其他方法

Practically anything I can think of in (C) will be miles faster than either of them. 实际上,我在(C)中想到的任何事物都将比它们中的任何一个都快几英里。 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. (B)实际上是一个非常差的协议设计。

By the time you have added all the required features to UDP you have TCP. 到将所有必需的功能添加到UDP时,您已经有了TCP。 Use TCP. 使用TCP。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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