1

I created a UDP server on android app, and this UDP server is reachable via wifi (Local network). I can receive and send data. However when I change to 4G network. The UDP server on Android not able to receive anything. I use ip chicken to check my cell phone IP address and my UDP server port is 2004. Is there anything wrong? or my public ip is not correct?

Lawrence song
  • 158
  • 1
  • 15

1 Answers1

1

Assuming that your phone IP address is correct, and it looks like you have checks this, it is important to know that mobile network providers may not support UDP inbound connections on their networks.

While it's not true to say that all don't, it is true to say that not all do so if you want your solution to be portable across networks you may need to look at alternatives anyway.

There are examples and guides on traversing network address translation boundaries on networks - one good example, which is looking at peer to peer applications, is here: http://bford.info/pub/net/p2pnat/

Mick
  • 24,231
  • 1
  • 54
  • 120