Which is the best approach to send large UDP packets in sequence
I have an android application that needs to send data through the protocol
UDP every 100 milliseconds. Each UDP packet has 15000 bytes average.
packets are sent in broadcast
Every 100 milliseconds lines below are run through a loop.
DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length,
broadcast, 9876);
clientSocket.send(sendPacket);
Application starts working fine, but after about 1 minute frequency of
received packets decreases until the packets do not arrive over the
destination.
The theoretical limit (on Windows) for the maximum size of a UDP packet is
65507 bytes
I know the media MTU of a network is 1500 bytes and when I send a packet
bigger it is broken into several fragments and if a fragment does not
reach the destination the whole package is lost.
I do not understand why at first 1 minute the packets are sent correctly
and after a while the packets do not arrive more. So I wonder what would
be the best approach to solve this problem?
No comments:
Post a Comment