InetSocketAddress(URL, PORT) takes lot of time to throw exception
-
02-10-2022 - |
Frage
Connection to Internet is removed. DNS is properly configured.
Try running the following line:-
new InetSocketAddress(URL, PORT);
This takes around 56 seconds to throw UnknownHostException.
Connection to Internet is removed. DNS is not configured.
Try running the following line:-
new InetSocketAddress(URL, PORT);
This takes less than 2 seconds to throw UnknownHostException.
Why?
Is there any solution to quickly throw Exception in Scenario 1?
Keine korrekte Lösung
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow