Warm tip: This article is reproduced from serverfault.com, please click

What is a default timeout for ldap connection

发布于 2017-12-11 09:28:56

I have Ldap connection.Please find below the code snippet :-

 public LdapConnection BindLDAPConnection()
    {
        var flag = 0;
        _ldapConnectionUsers = GetLDAPConnection();
        _ldapConnectionUsers.AuthType = AuthType.Basic;
        _ldapConnectionUsers.SessionOptions.SecureSocketLayer = false;
        _ldapConnectionUsers.SessionOptions.ProtocolVersion = 3;
        _ldapConnectionUsers.SessionOptions.VerifyServerCertificate =
  ServerCallback;
        //ldap.SessionOptions.VerifyServerCertificate =
        //      (con, cer) => true;
         password = GetPasswordForUser();
         NetworkCredential network = LdapHelper.GetNetworkCredentials();
        _ldapConnectionUsers.Timeout=new TimeSpan(0,0,10,0);
         _ldapConnectionUsers.Bind(network);
         return _ldapConnectionUsers;
    }

In the configuration part, I need to set the timeout for this connection.

What is the default timeout for ldap connection?

So that I can give that default timeout in the configuration part?

Questioner
sagar yadwad
Viewed
0
EricLavault 2017-12-11 22:06:50

LdapConnection.Timeout overrides DirectoryConnection.Timeout that defaults to 30 seconds.