2 lymlylllllllllllll lymlylllllllllllll 于 2013.09.29 10:50 提问

java.net.SocketException: socket closed

返回的httpresponse 内容如下
HTTP/1.1 200 OK [Server: zhihu_nginx, Date: Sun, 29 Sep 2013 02:08:35 GMT, Content-Type: application/json, Transfer-Encoding: chunked, Connection: keep-alive, Vary: Accept-Encoding, Expires: Fri, 02 Jan 2000 00:00:00 GMT, Pragma: no-cache, Cache-Control: private, no-store, max-age=0,no-cache, must-revalidate, post-check=0, pre-check=0]

报错如下:
Exception in thread "main" java.net.SocketException: socket closed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at org.apache.http.impl.io.SessionInputBufferImpl.streamRead(SessionInputBufferImpl.java:136)
at org.apache.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:152)
at org.apache.http.impl.io.SessionInputBufferImpl.read(SessionInputBufferImpl.java:203)
at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:174)
at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:137)
at java.util.zip.InflaterInputStream.fill(Unknown Source)
at java.util.zip.InflaterInputStream.read(Unknown Source)
at java.util.zip.GZIPInputStream.read(Unknown Source)
at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
at sun.nio.cs.StreamDecoder.read(Unknown Source)
at java.io.InputStreamReader.read(Unknown Source)
at java.io.Reader.read(Unknown Source)
at org.apache.http.util.EntityUtils.toString(EntityUtils.java:244)
at org.apache.http.util.EntityUtils.toString(EntityUtils.java:288)
at zhihu.ZhihuDownload.getAnswersList(ZhihuDownload.java:138)
at zhihu.ZhihuDownload.main(ZhihuDownload.java:54)

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!