mirror of https://github.com/M66B/FairEmail.git
Scan all addresses
This commit is contained in:
parent
d7d00556b9
commit
4a72f7ff90
|
@ -418,9 +418,16 @@ public class EmailProvider {
|
|||
@Override
|
||||
public Boolean call() {
|
||||
try (Socket socket = new Socket()) {
|
||||
InetAddress iaddr = InetAddress.getByName(host);
|
||||
InetSocketAddress inetSocketAddress = new InetSocketAddress(iaddr, Server.this.port);
|
||||
InetAddress[] iaddr = InetAddress.getAllByName(host);
|
||||
for (int i = 0; i < iaddr.length; i++)
|
||||
try {
|
||||
Log.i("Connecting to " + iaddr[i]);
|
||||
InetSocketAddress inetSocketAddress = new InetSocketAddress(iaddr[i], Server.this.port);
|
||||
socket.connect(inetSocketAddress, DNS_TIMEOUT);
|
||||
} catch (Throwable ex) {
|
||||
if (i + 1 == iaddr.length)
|
||||
throw ex;
|
||||
}
|
||||
Log.i("Reachable " + Server.this);
|
||||
return true;
|
||||
} catch (IOException ex) {
|
||||
|
|
Loading…
Reference in New Issue