Does SearchControls.setTimeLimit() handle read timeout?(SearchControls.setTimeLimit() 是否处理读取超时?)
问题描述
我遇到了一个问题,即针对目录的 LdapContext.search()
有时会永远挂起.我尝试提供一个名为 setTimeLimit(10000),
的 SearchControls
对象,但问题仍然存在.
I'm having an issue where an LdapContext.search()
against a directory will occasionally hang forever. I tried supplying a SearchControls
object for which I've called setTimeLimit(10000),
but the issue still happens.
鉴于此,我现在的想法是 SearchControls 对象仅用作服务器的建议,如果没有数据包返回,则不会在客户端读取时安排超时.我环顾四周,但没有在类文档中找到任何明确确认这一点的措辞.
Given this, my thought now is that the SearchControls object is being used only as an advisory to the server and won't arrange a timeout on the client side read if no packets come back. I looked around but didn't find any wording in the class documentation to explicitly confirm this.
谁能证实我的猜测 SearchControls 不会安排客户端读取超时,以及我是否应该改为使用 com.sun.jndi.ldap.read.timeout
来保护我的客户端案例?
Can anyone confirm my guess that SearchControls will not arrange a client side read timeout, and whether I should instead be using com.sun.jndi.ldap.read.timeout
to protect my client in this case?
推荐答案
你是对的.SearchControls.setTimeLimit () 不控制套接字读取超时.在 http://docs.oracle.com/javase/tutorial/查看更多信息jndi/newstuff/readtimeout.html
You are right. SearchControls.setTimeLimit () doesn't control socket read timeout. See more at http://docs.oracle.com/javase/tutorial/jndi/newstuff/readtimeout.html
这篇关于SearchControls.setTimeLimit() 是否处理读取超时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:SearchControls.setTimeLimit() 是否处理读取超时?


- C++ 和 Java 进程之间的共享内存 2022-01-01
- Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01
- Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01
- value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01
- Jersey REST 客户端:发布多部分数据 2022-01-01
- Eclipse 插件更新错误日志在哪里? 2022-01-01
- 如何使用WebFilter实现授权头检查 2022-01-01
- 从 finally 块返回时 Java 的奇怪行为 2022-01-01
- 将log4j 1.2配置转换为log4j 2配置 2022-01-01
- Java包名称中单词分隔符的约定是什么? 2022-01-01