This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.security.Security; | |
| import java.net.InetAddress; | |
| public class MakeTwoDnsRequests { | |
| public static void main(String[] args) throws Exception { | |
| // Disable JVM DNS caching | |
| Security.setProperty("networkaddress.cache.ttl", "0"); | |
| System.out.println(InetAddress.getByName("www.example.com").getHostAddress()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.apache.http.HttpHost; | |
| import org.apache.http.HttpRequest; | |
| import org.apache.http.HttpResponse; | |
| import org.apache.http.client.methods.HttpUriRequest; | |
| import org.apache.http.concurrent.FutureCallback; | |
| import org.apache.http.nio.client.HttpAsyncClient; | |
| import org.apache.http.nio.protocol.HttpAsyncRequestProducer; | |
| import org.apache.http.nio.protocol.HttpAsyncResponseConsumer; | |
| import org.apache.http.protocol.HttpContext; |