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() 是否处理读取超时?
基础教程推荐
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- 修改 void 函数的输入参数,然后读取 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- Struts2 URL 无法访问 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
