I am working with UDP and DatagramSocket. I verified that the Receive
function clear all data more of setLength of DatagramPacket. My
packets have a variable len. I use first two bytes to understand the
len packet.
public void run() {
byte []buff = new byte[1024];
}
private int ReadData(byte []byBuff, int iSize) throws IOException{
_datagram.setData(byBuff);
_datagram.setLength(iSize);
_socket.receive(_datagram);
int iRet = _datagram.getLength();
return iRet;
}
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en