[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
problem with blocking ldap_bind
- To: openldap-devel@OpenLDAP.org
- Subject: problem with blocking ldap_bind
- From: Helmut Lehner <lehnerh@atc.co.at>
- Date: Tue, 16 Jul 2002 11:09:13 +0200
- User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.0) Gecko/20020530
Hi!
I have a problem with the blocking ldap_simple_bind_s function.
I know that ldap_simple_bind_s is a synchronous call, but is it possible
to set a timeout, after the call returns for sure?
I found some hints about LDAP_OPT_NETWORK_TIMEOUT, but the call still
blocks longer than specified.
How does LDAP_OPT_NETWORK_TIMEOUT work?
I'm using OpenLDAP 2.0.25.
thanks in advance
Helmut Lehner
This is a small snippet from my example-code.
/* Code snippet */
....
if ((ld=ldap_init("ldap1",LDAP_PORT)) == NULL) {
printf("ldap_init\n");
return 1;
}
t1.tv_sec=5;
t1.tv_usec=0;
if (ldap_set_option(ld,LDAP_OPT_NETWORK_TIMEOUT,&t1)!=LDAP_OPT_SUCCESS){
printf("error ldap_set_option\n");
}
if ((rc=ldap_simple_bind_s(ld,"who" ,"password")) != LDAP_SUCCESS ) {
perror("LDAP: ldap_bind_s");
ldap_unbind(ld);
return 1;
}
...
/*end code */