[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
RE: problem with blocking ldap_bind
- To: openldap-devel@OpenLDAP.org
- Subject: RE: problem with blocking ldap_bind
- From: Helmut Lehner <lehnerh@atc.co.at>
- Date: Tue, 16 Jul 2002 12:58:49 +0200
- User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.0) Gecko/20020530
> No, no as easy as with the other synchrounus function calls like
> ldap_search_st(), which accept a timeout parameter. You'll have to
> implement your own ldap_bind_st() using the asyncrounus function
> calls:
>
> int ldap_bind_st(LDAP *ld, char *whop, char *credp) {
> int rc, msgid;
> struct timeval tm;
> LDAPMessage *res;
> [...]
> msgid = ldap_bind(ld, whop, credp, LDAP_AUTH_SIMPLE);
> rc = ldap_result(ld, msgid, 1, &tm, &res);
> [...]
> }
But ldap_bind still blocks too long for our purpose if there is no route
to the LDAP-server, for example.
> LDAP_OPT_NETWORK_TIMEOUT specifies the maximum time to wait to establish
> the TCP connection to the ldap server.
I also set the LDAP_OPT_NETWORK_TIMEOUT and ldap_bind hangs for a while
(longer as specified in LDAP_OPT_NETWORK_TIMEOUT).
Is there maybe another option i have to set, so that the call is
interrupted after a configurable time?
thanks
Helmut