So I have this code that I have been using successfully everywhere, until I tried it in android project. This is the code, its the most simple code.
try {
Socket socket = new Socket();
socket.connect(new InetSocketAddress(ip, port), timeout);
socket.close();
openPorts.add(port);
} catch (Exception ex) {
}
this code seems to fail on every single port and think that they are closed, even though the same code works excellent on desktop. Any ideas what could be wrong?