| Author |
java.net.SocketException (while getting data from an url)
|
subodh varshney
Greenhorn
Joined: Aug 01, 2005
Posts: 11
|
|
Hi All, i m using following code for url connection, and getting error. Please help me. URL url = new URL(urlString); HttpsURLConnection conn=(HttpsURLConnection)url.openConnection(); conn.setHostnameVerifier(new MyHostnameVerifier()); conn.setAllowUserInteraction(true); conn.setDoOutput(false); conn.setRequestMethod("GET"); conn.getContent(); BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream())); String str=""; String str1=""; while ((str = in.readLine()) != null) { if(!str.equalsIgnoreCase("")) System.out.println("STR:::::"+str); str1+=str+"\n"; } in.close(); <-------------------I am getting following error ----------------> java.net.SocketException: Unexpected end of file from server at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:802) at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:702) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:583) at java.net.URLConnection.getContent(URLConnection.java:582)Unable to send the message
|
 |
 |
|
|
subject: java.net.SocketException (while getting data from an url)
|
|
|