skip to Main Content

I’m developing an Android app that must connect to the server to retrieve some data. I’ve 2 devices connected on my local WIFI via a router: My development laptop (as server) and my development android phone (as client). The laptop has as IP address 192.168.41.50 and my Apache HTTP server is running on port 81.

My problem is the following:
If I run my android application to retrieve data into the server, it doesn’t work, it’s giving me a timeout exception:

D/OkHttp: <– HTTP FAILED: java.net.SocketTimeoutException: failed to connect to /192.168.43.50 (port 81) after 120000ms

But the same address is working on the laptop’s browserserver response

How can I solve this problem.

2

Answers


  1. Your problem solution is simple ->

    You have to allow external devices to connect your server.

    If you are using Wamp Server then look at this post for your answer ->

    How to enable local network users to access my WAMP sites?

    If you are using Xampp Server then look at this post for your answer ->

    Accessing localhost (xampp) from another computer over LAN network – how to?

    Hope this solve your problem.

    Login or Signup to reply.
  2. Have a look at the firewall.

    Switch it off for a test.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search