3 Replies - 7535 Views - Last Post: 19 August 2007 - 01:23 PM Rate Topic: -----

#1 itpro4470  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 5
  • View blog
  • Posts: 156
  • Joined: 17-June 07

url.openStream timeout

Posted 18 August 2007 - 09:44 PM

my program just checks for a connection by using
BufferedReader in=new BufferedReader(new InputStreamReader(aURL.openStream)
sometimes my program hangs at this line for quite a while.
is there any way to set a time out for this???
Is This A Good Question/Topic? 0
  • +

Replies To: url.openStream timeout

#2 alpha02  Icon User is offline

  • Sexy DIC God
  • member icon

Reputation: 47
  • View blog
  • Posts: 803
  • Joined: 20-May 06

Re: url.openStream timeout

Posted 18 August 2007 - 10:41 PM

What kind of object is aURL? Socket, HTTPRequest...

This post has been edited by alpha02: 18 August 2007 - 10:44 PM

Was This Post Helpful? 0
  • +
  • -

#3 itpro4470  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 5
  • View blog
  • Posts: 156
  • Joined: 17-June 07

Re: url.openStream timeout

Posted 19 August 2007 - 01:18 PM

its just a url
URL aUrl=new URL("www.yahoo.com");
Was This Post Helpful? 0
  • +
  • -

#4 alpha02  Icon User is offline

  • Sexy DIC God
  • member icon

Reputation: 47
  • View blog
  • Posts: 803
  • Joined: 20-May 06

Re: url.openStream timeout

Posted 19 August 2007 - 01:23 PM

You could try:

URLConnection conn = new URL("www.yahoo.com").openConnection();
BufferedReader  in = new BufferedReader(new InputStreamReader(conn.getInputStream()));


Then study the BufferedReader class :)
Was This Post Helpful? 1

Page 1 of 1