Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

java.net.SocketException: Unexpected end of file from server  RSS feed

 
Vanitha Anandan
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to read data from input stream.

connection.connect();
BufferedReader in = new BufferedReader(
new InputStreamReader(
connection.getInputStream()));

The data that is written is a bytearray.

But it throws error like

java.net.SocketException: Unexpected end of file from server
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:714)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:585)

Could anyone please let me know what is the cause and how can i rectify it?

Thanks in advance.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!