Android UDP packet loss

本小妞迷上赌 提交于 2019-12-24 11:28:12

问题


So i'm writing an app that sends 5Kb packets out 15 times a second through UDP. I understand I will lose some packets but I seem to be losing all my packets after the first couple seconds. Even if I slow it down to send the 5Kb packets out once every 10 seconds I will still lose them. What would cause this?


回答1:


It's not surprising that they are all dropped. A payload bigger than 512 bytes is unlikely to make it out of the network. It depends on the MTU of your router and how much bandwidth is allocated to UDP / internet traffic on the router.




回答2:


You'll be lucky to get any UDP datagram larger than about 1260 bytes at all. The generally accepted limit for UDP through routers is 534 bytes, which derives somehow from the IPv4 non-fragmentation minimum of 576 bytes.



来源:https://stackoverflow.com/questions/15825298/android-udp-packet-loss

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!