0

So basically I'm trying to achieve a TCP connection (ServerSocket, Socket) to a 3G mobile device running an ad-hoc service on Android (the client I'm using is an Android x86 desktop PC, but it could also be another 3G mobile device).

WhatIsMyIP gives me a correct IP address and a No proxy detected message from the mobile device.

Obviously, my first attempt trying to connect resulted in a:

java.net.SocketException: The operation timed out

Which I think is a bit logical, due to some limitation/protection from the mobile network operator, and this might be the source of the problem. I've read a similar question, but it's a little old, and not related with Android.

So is there any workaround for this problem in order to achieve a publicly accessible IP and PORT?

Community
  • 1
  • 1
Federico Cristina
  • 2,203
  • 1
  • 19
  • 37

1 Answers1

1

I think that the problem is also on the OS itself that you cannot wait for an connection on 3g interface, only on wireless. Not sure how to solve this with TCP, but with UDP its pretty simple: http://en.wikipedia.org/wiki/UDP_hole_punching

Ljudevit
  • 368
  • 3
  • 12