title: connecting two android devices via TCP sockets
body: <p>I've been trying to connect two Android devices (2.1) via TCP sockets.
  The vital part of the code:</p>
  
  <p>Server:
  ServerSocket serverSocket = new ServerSocket(SERVERPORT);</p>
  
  <p>Client:
  Socket socket = new Socket(serverAddr, SERVERPORT);</p>
  
  <p>The weird thing is I can make it work if the client is an emulator, but the same code fails if running both of them on real devices.
  The failure in the client side is:</p>
  
  <pre><code> 
  java.net.SocketException: No route to host
       at org.apache.harmony.luni.platform.OSNetworkSystem.connectSocketImpl(Native
   Method)
       at org.apache.harmony.luni.platform.OSNetworkSystem.connect(OSNetworkSystem.
  java:114)
       at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:
  245)
       at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:
  220)
       at java.net.Socket.startupSocket(Socket.java:780)
       at java.net.Socket.(Socket.java:314)
  </code></pre>
  
  <p>I tried with WIFI and mobile net too, they were in the same subnet both times, INTERNET permission is given, the server is addressed through its real 192.168.. IP.<br>
  I am planning to change the socket implementation with setCustomSocketImplFactory().<br>
  The problem is crucial in the process of implementing MSRP protocol to Android.<br>
  Can anyone give me some advice?  </p>