LdapException: The operation was aborted because the client side timeout limit was exceeded - Closed.

Dec 21, 2011 at 3:58 PM

Sometimes I'm seeing an LdapException: The operation was aborted because the client side timeout limit was exceeded.

Is there anything we can do in configuration to avoid this, other than changing the query?

Coordinator
Dec 22, 2011 at 2:26 AM
Edited Dec 22, 2011 at 2:27 AM

I checked in changes to support this, but if you don't want to build the project from the trunk, you can subclass ConnectionFactoryBase like so

var config = new LdapConfiguration();

config.ConfigureCustomFactory(new CustomConnectionFactory("localhost"));

public class CustomConnectionFactory : ConnectionFactoryBase, ILdapConnectionFactory
{
    public CustomConnectionFactory(string serverName) : base(serverName)
    {
        //configure what you want here.
    }

    public LdapConnection GetConnection()
    {
        var connection = BuildConnection();
        connection.Timeout = TimeSpan.FromSeconds(60);

        return connection;
    }

    public void ReleaseConnection(LdapConnection connection)
    {
        connection.Dispose();
    }
}

Dec 22, 2011 at 11:30 AM

I'm happy to build from the Trunk - I'd been using it for debugging, anyway.  I'm now running the latest trunk code and my timeouts are no more.  Thank you.