[python-ldap] ldap.init_fd() patch for python-ldap-2.4.15
Mark R Bannister
mark at proseconsulting.co.uk
Wed Sep 10 18:54:25 CEST 2014
On 10/09/2014 13:43, Michael Ströder wrote:
> Mark R Bannister wrote:
>> I needed ldap.init_fd(), so I wrote a patch. Please find attached. Hope this
>> works for you too. I've only tested on OpenSuSE.
> Could you please elaborate on why you need that?
>
> Ciao, Michael.
>
>
Hi Michael,
Yes of course. I have a multi-threaded server that maintains a pool of
worker threads. Each thread can manage multiple client requests, and
each client request may be processing a different LDAP connection. The
main worker loop needs to select() on a list of file descriptors to see
if there is any pending I/O to process. This might be new incoming
sockets, new commands received from existing clients, or new data
received from an asynchronous LDAP operation.
I therefore need ldap.init_fd() so that I have a file descriptor that I
can pass to select().
Best regards,
Mark.
More information about the python-ldap
mailing list