ldap3.strategy.async module

class ldap3.strategy.async.AsyncStrategy(ldap_connection)

Bases: ldap3.strategy.base.BaseStrategy

This strategy is asynchronous. You send the request and get the messageId of the request sent Receiving data from socket is managed in a separated thread in a blocking mode Requests return an int value to indicate the messageId of the requested Operation You get the response with get_response, it has a timeout to wait for response to appear Connection.response will contain the whole LDAP response for the messageId requested in a dict form Connection.request will contain the result LDAP message in a dict form Response appear in strategy._responses dictionary

class ReceiverSocketThread(ldap_connection)

Bases: threading.Thread

The thread that actually manage the receiver socket


Wait for data on socket, compute the length of the message and wait for enough bytes to decode the message Message are appended to strategy._responses


Close connection and stop socket thread

AsyncStrategy.open(reset_usage=True, read_server_info=True)

Open connection and start listen on the socket in a different thread

Clears connection.response and returns messageId


Clears connection.response and returns messageId.