title: Android http connection - multiple devices cannot connect the same server
body: <p>I really need help here...</p>
  
  <p>I have a simple Android application that connects to my sever to fetch data over HTTPS. </p>
  
  <p>Everything is working fine up until i connected to the same server from another device (iOS or Android). I am starting to get timeouts or connection refused or other errors depending on the library that I use (sometimes SSL handshake)</p>
  
  <ol>
  <li><p>I tried 2 android app on the same router - fails</p></li>
  <li><p>I tried Volley, Retrofit, plain http library - fails</p></li>
  <li><p>if one device is connected via cellular network and one on wifi, it is working fine. However, i have seen cases that it fails even using 2 devices connected to cellular network and not wifi.</p></li>
  <li><p>It is easy to reproduce. one app is working fine. as soon as i do an operation on the other device. the first app will not be able to connect.</p></li>
  <li><p>iOS app using the same api/server is working fine. no failures</p></li>
  <li><p>I ran wireshark on the android app during failure and received the following:</p></li>
  </ol>
  
  <p>70  47.073286   10.0.0.1    10.0.0.138  ICMP    120 Destination unreachable (Port unreachable)</p>
  
  <p>Seems like port issues. I am not sure anymore if this is a server issue or a client issue.. iOS app works fine. no issues. Only Android.</p>
  
  <p>I tried:</p>
  
  <pre><code>System.setProperty("http.keepAlive", "false");
  </code></pre>
  
  <p>I tried setting an http header "<code>connection :close</code>" nothing works...</p>
  
  <p>Any idea would be appreciated...</p>