Socket: Connect spends 2 minutes looking for IP before it timesOut. I want to reduce that time to 10-15 seconds.
For connection I am using following code....
public static boolean available (String host, String port){
try {
Socket s = new Socket (host, port);
return true;
}
catch (Exception e) {
return false;
}
}
How do I minimize timeout time to 10-15 seconds instead of 2 minutes? Is there any method to do that or any other alternate way?