1

I know similar questions have been asked but this one is slightly different.

We have an app that does some HTTP connectivity with our server.

While running the app on an LG Nexus 5X or Sumsung Galaxy 5, using any of our 3 WiFi routers, the connection times out ("SocketTimeoutException: timeout" due to "SocketException: Socket closed"). The connection doesn't timeout if we use cellular network, tethering between devices or the simulator on a laptop connected to the same (problematic) WiFi routers.

Just to point out, the routers are connected to different ISPs.

Did anyone ever experience anything like it or have an idea?

Thanks

7
  • maybe your wifi router blocks the phones' mac addresses Commented Nov 9, 2016 at 13:30
  • Check if you are using the correct baseurl? hit the same API in browser or postman and check if it is working? Commented Nov 9, 2016 at 13:32
  • Did check the url from Chrome on the LG and it works. The app does connect to a server running locally (on the same network). Commented Nov 9, 2016 at 13:34
  • May be some routers have restrictions to access the URL can you check security settings of your routers. Commented Nov 9, 2016 at 13:49
  • We can access the urls from Chrome on these devices or from the simulator on a laptop, using these routers. The issue seems to be between the routers and the app (Retrofit, OkHttp ?) on these devices. Commented Nov 9, 2016 at 14:13

1 Answer 1

1

SOLVED: Trying a GET instead of a POST (with a JSON body of ~4K bytes) seemed to work fine. So, after a session with tcpdump, server side, it turned out that the request does reach the server but it's "corrupted". The first ~300 bytes and the last ~1000 bytes do reach the server but the middle ~2500 bytes are missing (could be due to some service provider infrastructure/ shaper or whatever).

In any case, lowering the buffer size of the OKHttpClient instance (providing it with a new SocketFactory) to 512, did the trick.

Thanks to all of those who tried to assist.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.