简体   繁体   中英

Only 16 UDP 512 byte packets being received by server when I sent 7mb total

I break a 7mb file into 512b chunks and I send it with udp to a server. About 14000 packets get sent by the client but on the server side socket.receive(packet) blocks after receiving only 16 packets.

Any ideas what's going on here?

UDP is defined as an unreliable protocol. Packets may be lost, and without the sender being informed. They may also arrive out of order and even duplicates may arrive.

UDP is suitable for purposes where error checking and correction is either unnecessary, or is performed by the application itself.

If you want a reliable protocol, start using TCP.

In contrast to TCP, UDP does neither ensure packet order nor actual delivery (no flow control as in TCP). See this question: ensuring packet order in 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