0

I have developed application. I have used socket connection. I am able to open socket on wifi but unable to socket on 3G. I have googled but not got any luck.

Please help me.

Here is my code:

SocketAddress socketAddress = new InetSocketAddress(uri.getHost(), port); 
this.socketChannel = SocketChannel.open(); 
this.socketChannel.configureBlocking(false); 
this.socketChannel.connect(socketAddress); // Create a Selector and attach to SocketChannel
Selector selector = Selector.open(); this.socketChannel.register(selector,
this.socketChannel.validOps());

Thanks in advance.

DJ Burb
  • 2,346
  • 2
  • 29
  • 38
Shrikant Salunkhe
  • 329
  • 1
  • 4
  • 14
  • what code are you using for socket connection? – DJ Burb Oct 06 '14 at 21:07
  • Look this link http://stackoverflow.com/questions/17305498/android-why-sending-information-to-server-works-with-wifi-only – Tobiel Oct 06 '14 at 21:21
  • @DJBurb I am using below code: SocketAddress socketAddress = new InetSocketAddress(uri.getHost(), port); this.socketChannel = SocketChannel.open(); this.socketChannel.configureBlocking(false); this.socketChannel.connect(socketAddress); // Create a Selector and attach to SocketChannel Selector selector = Selector.open(); this.socketChannel.register(selector, this.socketChannel.validOps()); – Shrikant Salunkhe Oct 07 '14 at 07:34

0 Answers0