Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #22310

Re: connect timeout

X-Received by 10.66.90.67 with SMTP id bu3mr730832pab.45.1360874293710; Thu, 14 Feb 2013 12:38:13 -0800 (PST)
X-Received by 10.50.207.100 with SMTP id lv4mr130298igc.1.1360874293440; Thu, 14 Feb 2013 12:38:13 -0800 (PST)
Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!su1no921595pbb.0!news-out.google.com!ov8ni9pbb.1!nntp.google.com!su1no921590pbb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.java.programmer
Date Thu, 14 Feb 2013 12:38:12 -0800 (PST)
In-Reply-To <c45c592d-9d52-490b-b2d0-66eaaff38123@googlegroups.com>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=69.28.149.29; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T
NNTP-Posting-Host 69.28.149.29
References <c45c592d-9d52-490b-b2d0-66eaaff38123@googlegroups.com>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <91f39950-71c9-467f-b6a5-e861442eff61@googlegroups.com> (permalink)
Subject Re: connect timeout
From Lew <lewbloch@gmail.com>
Injection-Date Thu, 14 Feb 2013 20:38:13 +0000
Content-Type text/plain; charset=ISO-8859-1
Xref csiph.com comp.lang.java.programmer:22310

Show key headers only | View raw


bob smith wrote:
> 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);

http://docs.oracle.com/javase/7/docs/api/java/net/Socket.html

HTH.

-- 
Lew

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

connect timeout bob smith <bob@coolfone.comze.com> - 2013-02-14 11:22 -0800
  Re: connect timeout Lew <lewbloch@gmail.com> - 2013-02-14 12:38 -0800
  Re: connect timeout Arne Vajhoej <arne@vajhoej.dk> - 2013-02-15 08:48 -0500
    Re: connect timeout Lew <lewbloch@gmail.com> - 2013-02-15 07:21 -0800
    Re: connect timeout mike7411@gmail.com - 2013-02-15 08:07 -0800
      Re: connect timeout Arne Vajhoej <arne@vajhoej.dk> - 2013-02-15 12:05 -0500
        Re: connect timeout "John B. Matthews" <nospam@nospam.invalid> - 2013-02-16 13:21 -0500

csiph-web