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
|
@Override
|
||||||
public Boolean call() {
|
public Boolean call() {
|
||||||
try (Socket socket = new Socket()) {
|
try (Socket socket = new Socket()) {
|
||||||
InetAddress iaddr = InetAddress.getByName(host);
|
InetAddress[] iaddr = InetAddress.getAllByName(host);
|
||||||
InetSocketAddress inetSocketAddress = new InetSocketAddress(iaddr, Server.this.port);
|
for (int i = 0; i < iaddr.length; i++)
|
||||||
socket.connect(inetSocketAddress, DNS_TIMEOUT);
|
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);
|
Log.i("Reachable " + Server.this);
|
||||||
return true;
|
return true;
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
|
|
Loading…
Reference in New Issue