I'm having a very strange problem with my android application, in some cases my application can not respond to valid addresses from other sites. Explaining my application, it is a data collection application in the field, where it connects with the client server to transfer the information remotely, via socket connection, the problem is that some clients my application can connect and others not, I did several tests with varied addresses, some the application gets answer and some do not. Here is the verification code:
if (InetAddress.getByName(sys.getNr_ipexterno()).isReachable(3000)) {
ipAcessivel = sys.getNr_ipexterno();
Log.d("IP" , sys.getNr_ipexterno() + " Responde");
try {
Socket socket = new Socket(ipAcessivel, 5555);
} catch (IOException e) {
e.printStackTrace();
ipAcessivel = "";
}
}
The problem is that my system can not even do the address validation, as it is in the first line of this code.