Here is my code :
URL u = new URL(\"http://www.google.com\"); URLConnection conn = u.openConnection(); conn.setConnectTimeout(3000); conn
Some non-standard implmentation of this method may ignore the specified timeout. See this setConnectTimeout