Pregunta

Firstly I appreciate the UDP is not a reliable protocol, and I am not guaranteed to receive packets across a network.

However, if the packet does reach my machine, am I guaranteed to receive it at the application level, or can the network stack throw it away with impunity?

The reason I ask is that I seem to be missing packets occasionally, even though I know they're on the wire (simple EtherCAT bus, so packets always loop back).

¿Fue útil?

Solución

No, there is no guarantee the packets will reach your application even if they reach your machine.

The kernel's UDP receive queue is finite, and if the packets arrive faster than your application can handle them, the queue will fill up and some of the packets will be dropped.

You can increase the size of the receive buffer (see this question), but you cannot make it unlimited.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top