开发者

What happens if a HttpClient.execute() is interrupted?

I am calling HttpClient.execute() in a background thre开发者_JS百科ad. Does it throw an IOException, when I interrupt the thread?


No, at least I haven't ever seen it do so. Note that you can interrupt a download by checking Thread.currentThread().isInterrupted() as you copy from the httpEntity.getContent().

There is more discussion on closing connections in other states here http://old.nabble.com/Close-interrupt-HTTP-connections-td30299655.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜