SimpleHttpConnectionManager使用不正确 [英] SimpleHttpConnectionManager being used incorrectly
问题描述
SimpleHttpConnectionManager使用不正确。确保始终调用HttpMethod.releaseConnection(),并且一次只有一个线程和/或方法使用此连接管理器。
SimpleHttpConnectionManager being used incorrectly. Be sure that HttpMethod.releaseConnection() is always called and that only one thread and/or method is using this connection manager at a time.
是否有人知道为什么会出现此错误显示并导致我要下载的文件或失败并重试或下载未完成的
Does Anyone know why this error shows up and is causes the files I want to download or to fail and retry or to download uncompleted
谢谢!
推荐答案
确保不使用SimpleHttpConnectionManager来创建和使用来自多个线程的连接。简单的连接管理器不是为它设计的 - 它总是返回相同的连接,这不是线程安全的。
Make sure that you don't use SimpleHttpConnectionManager to create and use connections from multiple threads. The simple connection manager is not designed for it - it returns always the same connection, and this is not thread safe.
在多线程环境中,使用不同的管理器使用连接池。请参阅 MultiThreadedHttpConnectionManager 。
In a multi-threaded environment, use a different manager that uses a pool of connections. See MultiThreadedHttpConnectionManager.
这篇关于SimpleHttpConnectionManager使用不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!