Search code examples
javaandroidgprs

gprs gateway: why I can't connect to my server?


I am developing android phone application, communicate with my server. My server program listens on port 9999. If I use the wifi connection, everything is fine, but if I switch to GPRS connection, the client can't reach the server.

By tcpdumping the packet, I found when GPRS is enabled, every packet goes to the GPRS gateway with 80 port.

I am wondering what I should do to make my client be able to reach 9999 port of my server in GPRS case?


Solution

  • Can your server be reached by its IP? Try to connect to it with IP:port pair, where you specify desired port

    http://developer.android.com/reference/java/net/InetAddress.html http://developer.android.com/reference/java/net/InetSocketAddress.html