Multithreaded applications
A multi-threaded application that uses system or library calls can use the ldap_get_errno() to indicate the error type.
The LDAP client library is re-entrant. While a multithreaded application can safely use the LDAP library on multiple threads within the application, there are a few considerations to keep in mind:
- The
ldap_get_errno()API obtains information about the most recent error that occurred on the current thread for the specified LDAP connection. It does not return the most recent LDAP error that occurred on any thread. - If an operation results in more than one response message from a server, then all the response messages are returned to only one thread. The thread that reads the first response message for that operation must read all the remaining response messages as well.
- The locale is applicable to all conversions by the LDAP library within the application address space. The LDAP locale must be set or changed only when there is no other LDAP activity that occurs within the application on other threads.