Controlling Connection Pooling for TCP and Named Pipes

Continuing on the themes of changes and quotas, today's post is about how the connection pool quotas and settings moved for the connection-oriented transports. The last time I talked about connection pool quotas, these knobs lived on the binding elements of the transports. All of these knobs are still available in some form but there now is one level of indirection from the binding element.

We found that the names of the connection pool quota knobs were confusing people, especially the IdleTimeout quota that many people thought was a timeout for the transport rather than the connection pool. At the same time, there weren't any good names for these settings because any name that was clear enough to indicate that the setting was for the connection pool was going to be a really, really long name. We compromised by keeping the names of the connection pool settings short but moving those settings to a subobject of the binding element. The ConnectionPoolSettings property collects all of these settings in one place for each of the transports with a connection pool.

 public sealed class NamedPipeConnectionPoolSettings
{
   public string GroupName { get; set; }
   public TimeSpan IdleTimeout { get; set; }
   public int MaxOutboundConnectionsPerEndpoint { get; set; }
}

public sealed class TcpConnectionPoolSettings
{
   public string GroupName { get; set; }
   public TimeSpan IdleTimeout { get; set; }
   public TimeSpan LeaseTimeout { get; set; }
   public int MaxOutboundConnectionsPerEndpoint { get; set; }
}

The old ConnectionLeaseTimeout is now called LeaseTimeout and the names of the other settings are unchanged.

Next time: Pieces of the Messaging Framework

Comments