I am currently testing my WPF / WCF client application in .NET 4.5 vs 4.0 with the goal of final outputting 4.5 to all client machines. The WCF part uses BasicHttpBinding / SOAP.
When testing two client versions under the same conditions (Win7, etc.), we observe an increase in "new TCP connections" by 10 times to the endpoint of the SOAP server. 4.0 clients install ~ 450 per hour, and 4.5 clients install ~ 6000. Since we are connecting to a remote server, this causes problems because establishing a new TCP connection adds a lot of delay to the web service call.
With 4.0, we preconfigured the ServicePointManager client settings to maximize the reuse of TCP connections and expected these settings to apply to 4.5.
My application usually makes one call at a time, perhaps every 10 seconds on average - with queues of 10 simultaneous calls every few minutes.
I looked through the list of changes and cannot find links to corrections / changes made to this part of .NET. Can anyone shed light on what can happen here?
ServicePointManager.UseNagleAlgorithm = true; ServicePointManager.Expect100Continue = false; ServicePointManager.DefaultConnectionLimit = 50; ServicePointManager.MaxServicePointIdleTime = 10000; Binding binding = new BasicHttpBinding { SendTimeout = TimeSpan.FromSeconds(_settings.SendTimeout), ReceiveTimeout = TimeSpan.FromSeconds(_settings.SendTimeout), MaxReceivedMessageSize = 1024 * 1024 * 10, MaxBufferSize = 1024 * 1024 * 10, MaxBufferPoolSize = 1024 * 1024 * 100, Security = { Mode = BasicHttpSecurityMode.TransportCredentialOnly, Message = { ClientCredentialType = BasicHttpMessageCredentialType.UserName }, Transport = { ClientCredentialType = HttpClientCredentialType.Basic }, }, };
source share