L
L
lilpersil2021-02-06 23:18:23
Java
lilpersil, 2021-02-06 23:18:23

How to connect android application via LAN to java server?

There was a problem connecting the application and the server in java. The fact is that even when I open a socket via InetAddress.getLocalHost I get an ip from it and try to connect to this ip from the application, I get an error of the following kind

W/System.err: java.net.ConnectException: failed to connect to /192.168.42.226 (port 6745) from /:: (port 60132): connect failed: ETIMEDOUT (Connection timed out)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Volodar Znatsky, 2021-02-07
@ja8mraz

It is possible that:
The firewall is blocking connections on the specified port
Incorrectly configured network, blocking IP routing
Timeout is not enough. You can try to increase
(You have a local IP address in error. The application and the server are running on the same network, I hope)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question