Skip to content

Instantly share code, notes, and snippets.

@chgeuer
Created August 16, 2011 14:45
Show Gist options
  • Save chgeuer/1149246 to your computer and use it in GitHub Desktop.
Save chgeuer/1149246 to your computer and use it in GitHub Desktop.
Turn off HTTP KeepAlive
// When testing in an NLB environment, it's helpful to test
// with a WCF client which doesn't reuse open TCP connections
// for HTTP...
var bindingElements = wcfBinding.CreateBindingElements();
var httpBe = bindingElements.OfType<HttpTransportBindingElement>().FirstOrDefault();
if (httpBe != null)
{
httpBe.KeepAliveEnabled = false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment