Win a copy of Murach's Python Programming this week in the Jython/Python forum!
    Bookmark Topic Watch Topic
  • New Topic

url connection: IOException-socket closed  RSS feed

 
vishnu kulkarni
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi
Iam trying to read the contents from the url.
Iam getting IOException:socket closed. Here is the code....


try
{
logger.debug(CLASS_NAME,METHOD_NAME,"Entering url" );
URL url = new URL(t_url);
URLConnection urlc = url.openConnection();
//**************URL authentication
urlc.setRequestProperty ("Authorization", "Basic " + encoding);
InputStream content = (InputStream)urlc.getInputStream();

BufferedReader in = new BufferedReader(new InputStreamReader(content));

while((inputLine = in.readLine())!= null)
{
buf.append(inputLine);
System.out.println("The inputLine is " + buf.toString());
}
in.close();
}

buf is the string buffer
Could any one please help me out?
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
Welcome to the JavaRanch, Vishnu.
Please do not post the same question more than once. Multiple posts causes confusion and duplication of effort as the community tries to help everyone. I'm going to close this copy, as I think the Sockets and Internet Protocols is a more appropriate forum.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!