本文介绍了我需要关闭Apache HTTPAsyncClient中过期的连接吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要像使用HttpClient一样关闭Apache HttpAsyncClient中的过期连接吗?

Do I need to close expired connections in Apache HttpAsyncClient as is done with HttpClient?

推荐答案

我只是仔细检查了源代码。是的,仍然必须显式从池中逐出过期的连接。 然而,,底层的NIO通道和套接字将被关闭并立即释放。连接不会自动从池中移除的问题是HttpAsyncClient 4.0 beta3中的一个错误。随时为此缺陷提出JIRA。

I just double-checked the source code. Yes, one still has to explicitly evict expired connections from the pool. However, the underlying NIO channel and socket will get closed and released immediately. The problem with expired connections not being automatically evicted from the pool is a bug in HttpAsyncClient 4.0 beta3. Feel free to raise a JIRA for this defect.

这篇关于我需要关闭Apache HTTPAsyncClient中过期的连接吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 20:08