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() 是否处理读取超时?
基础教程推荐
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- 降序排序:Java Map 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01