Regarding connection timed out exception

Hi all,

I need a help. I am using URL class to connect Google

try

{

URL url = new URL("http://www.google.com");

URLConnection myConn = (HttpURLConnection)url.openConnection();

myConn.setRequestProperty("User-agent","");

buffer = new BufferedReader(new InputStreamReader(myConn.getInputStream()));

sb1.append(line);

}//string buffer while closing

buffer.close();

}

catch(Exception e)

{

System.out.println("exception1 in url is "+e);

}

I am getting java.net.ConnectException:Connection timed out. please any one help me how i can resolve it.

Regards,

Rama

[679 byte] By [RamaDevia] at [2007-11-27 11:37:48]
# 1

First off, please enclose your code segments with the code tags.

As far as your question is concerted, it seems like its a problem with your net connection.

Sorry I cant be of further assistance. It looks as though your code logic is right.

smithdale87a at 2007-7-29 17:16:33 > top of Java-index,Core,Core APIs...