X-Received: by 10.224.72.199 with SMTP id n7mr1272654qaj.5.1360869772595; Thu, 14 Feb 2013 11:22:52 -0800 (PST) X-Received: by 10.49.34.135 with SMTP id z7mr1655748qei.1.1360869772538; Thu, 14 Feb 2013 11:22:52 -0800 (PST) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!t2no348172qal.0!news-out.google.com!k2ni33058qap.0!nntp.google.com!t1no352613qaz.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.java.programmer Date: Thu, 14 Feb 2013 11:22:52 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=64.183.216.122; posting-account=v1lx5wkAAAALWYfGBkwkMb2guPF9cW2u NNTP-Posting-Host: 64.183.216.122 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: connect timeout From: bob smith Injection-Date: Thu, 14 Feb 2013 19:22:52 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: csiph.com comp.lang.java.programmer:22309 Is there any way to specify the connection timeout for a java.net.Socket? I might want something like this to throw a ConnectException within 10 seconds: Socket socket = new Socket(ip_address, 80); Thanks.