Thank you! That did the trick....Don't know how I missed it.

-----Original Message-----
From: Chris Ridd [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 04, 2003 12:17 PM
To: JPrimant; Perl-ldap-dev Mailing List
Subject: Re: LDAP timeout parameter not functioning?

On 4/7/03 5:54 pm, JPrimant <[EMAIL PROTECTED]> wrote:

> 
> I have written a Perl/Tk program for Windows/UNIX clients that queries
a
> Microsoft Active Directory (AD) domain controller running LDAP.
Typical
> "ends with" type query filters, i.e. sAMAccountName\=*userid, can take
> several minutes to produce a result. Also, a user may attempt an
> unreasonable and lengthy search, querying all users in the company
that
> begin with the letter 'a' (producing thousands of results) for
example.
> The Tk program then looks like it is hung for several minutes. So, I
am
> attempting to provide a configurable timeout that can be set on the
> Perl/Tk main window that is used in the search query. I have found
that
> the timeout parameter does not function. Here is an example that takes
> several minutes to perform the query. The timeout parameter does not
> abort the query. Can anyone guide me on how to get the timeout
parameter
> to work?
> 
> Joe Primanti
> 
> 
> 
> Example: 
> 
> use Net::LDAP;
> $base = "dc=aaa, dc=bbb, dc=com";
> $userid = "*userid";
> 
> if ($ldap = Net::LDAP->new("aaa.bbb.com", port => 3268, timeout =>
10))
> {
> $qry = "(&(sAMAccountName\=$userid))";
> $mesg = $ldap->search(
> base => $base,
> attrs => [
> attr => 'mail',
> ],
> filter => $qry,
> timeout => 10,

Try this:

    timelimit => 10,

In the search argument list instead!

Cheers,

Chris

Reply via email to