Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
python-LDAP で「simple_bind_s」のタイムアウトを手動で設定する方法はありますか? ldapObject.timeout = 10 をテストしましたが、うまくいきませんでした。何か案は?
前もって感謝します..
ldap.OPT_NETWORK_TIMEOUTldap オブジェクトのオプションを設定します。
ldap.OPT_NETWORK_TIMEOUT
import ldap l = ldap.initialize('ldap://servername:389') l.set_option(ldap.OPT_NETWORK_TIMEOUT, 10.0) l.simple_bind_s('username', 'password')
指定されたタイムアウトに達すると、ldap.SERVER_DOWN 例外が発生します。