My Android application stalls at s.receive(p) because it is not receiving any packets.
I have X-Plane sending packets of data to random port 49059 in the SAME IP address as the Android Tablet that I want to receive those packets. This is because they are running off the same connection. X-Plane uses ports 49000 to send packets and 49001 to receive packets.
I cannot figure out what is wrong. I can't use 3G on the Android tablet, and this is the only internet connection I can test on. Also, ALL internet and wifi permissions are enabled in the manifest. Any ideas? Here's the code:
byte[] bar = new byte[1024];
DatagramPacket p = new DatagramPacket(bar, bar.length);
DatagramSocket s = new DatagramSocket(49059);
s.setSoTimeout(30000);
s.receive(p);