开发者

udp for large data file

开发者 https://www.devze.com 2023-02-17 22:05 出处:网络
I need to transfer a big data file (image file) using UDP protocol in Ja开发者_Python百科va. Any resources / links to do it will be helpful.The main thing you will need is a layer to add reliability.

I need to transfer a big data file (image file) using UDP protocol in Ja开发者_Python百科va. Any resources / links to do it will be helpful.


The main thing you will need is a layer to add reliability. http://www.google.co.uk/search?q=java+reliable+udp UDP is not reliable and any or all of the image could be lost unless you have a protocol on top of UDP to make it reliable.

I suggest you impliment this using TCP first as this is much simpler, and change it to UDP if you feel you still need to later.


Have a look at the trivial file transfer protocol (TFTP) - it implements a file transfer over UDP.

In real life, when not limited to UDP, you would use something TCP-based, as you have to implement everything again what TCP gives you over UDP, and most probably you would do this less efficient than your TCP-stack could have done.

0

精彩评论

暂无评论...
验证码 换一张
取 消