From: Mark W. <mew...@un...> - 2000-06-20 16:37:26
|
The timeout only applies before you get a response. Most likely the server has sent a response to your request, thus the timeout never comes into play. If you think there is a bug in the timeout code, send a copy of the output of $ldap->debug(3). Mark On Tue, 20 Jun 2000, Thomas Fahle wrote: > Hi, > > how to time out queries that have no result? > > use Net::LDAP; > use Net::LDAP::Util qw(ldap_error_name ldap_error_text) ; > > $ldap_host = 'xx.xx.xx.xx'; > $ldap = Net::LDAP->new($ldap_host) or die $@; > > # superbroker account > > $ldap->bind(dn => 'cn=Administrator, > o=SomeCompany,ou=Members', > password => 'topsecret', > ) or die $@; > > $base= 'o=SomeCompany, ou=Members'; > > $surname = 'McDonalds'; > > $searchstring = "sn=$surname"; > > $result = $ldap->search( > base => "$base", > filter => > "$searchstring", > timelimit => '10', > ); > $result->code && die $result->error; > > $Number_of_Entries = $result->count; > > &handle_entries unless ( $Number_of_Entries == 0); > > If the surname exists everything works fine. > > But the query won't time out when there is no result. > I've tried the $SIG{ALRM} approach, too. > > > Enviroment: > > MS-LDAP > Net::LDAP 0.19 on a Red-Hat Linux-Box > > > Tia > > Thomas > > > > > |