Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

IOException:socket closed  RSS feed

 
vishnu kulkarni
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • 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();
}


Could any one please help me out?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!