0

我正在使用 UDP 为 ar 无人机编写程序,但无人机有时会挂起,我认为 UDP 可能不够大,如果仍然使用 UDP,有什么办法可以改善这种情况?

4

1 回答 1

0

UDP datagram sizes are limited by:

  1. The outgoing socket send buffer. Defaults for this vary wildly, from 8k in Windows to 53k or more in other systems.

  2. The Path MTU or Maximum Transmission Unit of the entire network path between you and the receiver. This is typically no more than 1260 bytes.

The safest size for a UDP datagram is 534 bytes as this will never be fragmented by the transport. If you're planning on sending datagrams larger than this you need to consider a different transport, usually TCP.

于 2012-06-22T08:38:44.747 回答