开发者

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

开发者 https://www.devze.com 2023-01-15 18:29 出处:网络
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

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

精彩评论

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