internal void ApplyConfiguration(NamedPipeConnectionPoolSettings settings) { if (settings == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("settings"); } settings.GroupName = this.GroupName; settings.IdleTimeout = this.IdleTimeout; settings.MaxOutboundConnectionsPerEndpoint = this.MaxOutboundConnectionsPerEndpoint; }
internal void InitializeFrom(NamedPipeConnectionPoolSettings settings) { if (settings == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("settings"); } this.GroupName = settings.GroupName; this.IdleTimeout = settings.IdleTimeout; this.MaxOutboundConnectionsPerEndpoint = settings.MaxOutboundConnectionsPerEndpoint; }
internal void InitializeFrom(NamedPipeConnectionPoolSettings settings) { if (null == settings) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("settings"); } SetPropertyValueIfNotDefaultValue(ConfigurationStrings.GroupName, settings.GroupName); SetPropertyValueIfNotDefaultValue(ConfigurationStrings.IdleTimeout, settings.IdleTimeout); SetPropertyValueIfNotDefaultValue(ConfigurationStrings.MaxOutboundConnectionsPerEndpoint, settings.MaxOutboundConnectionsPerEndpoint); }
static void Main() { // protected // NamedPipeTransportBindingElement bElementClone = // new NamedPipeTransportBindingElement(bElement); // <Snippet3> // <Snippet2> // <Snippet0> // <Snippet1> NamedPipeTransportBindingElement bElement = new NamedPipeTransportBindingElement(); // </Snippet1> NamedPipeConnectionPoolSettings connectionPoolSettings = bElement.ConnectionPoolSettings; // </Snippet0> // </Snippet2> // </Snippet3> // <Snippet4> string scheme = bElement.Scheme; // </Snippet4> // <Snippet5> BindingElement bElementCopy = bElement.Clone(); // </Snippet5> // <Snippet8> BasicHttpBinding binding = new BasicHttpBinding(); ISecurityCapabilities b = binding.GetProperty <ISecurityCapabilities> (new BindingParameterCollection()); bool SupportsServerAuthentication = b.SupportsServerAuthentication; // </Snippet8> }
public void DefaultValues() { NamedPipeTransportBindingElement be = new NamedPipeTransportBindingElement(); Assert.AreEqual(TimeSpan.FromSeconds(5), be.ChannelInitializationTimeout, "#1"); Assert.AreEqual(0x2000, be.ConnectionBufferSize, "#2"); Assert.AreEqual(HostNameComparisonMode.StrongWildcard, be.HostNameComparisonMode, "#3"); Assert.AreEqual(0x10000, be.MaxBufferSize, "#4"); Assert.AreEqual(TimeSpan.FromMilliseconds(200), be.MaxOutputDelay, "#5"); Assert.AreEqual(1, be.MaxPendingAccepts, "#6"); Assert.AreEqual(10, be.MaxPendingConnections, "#7"); Assert.AreEqual(TransferMode.Buffered, be.TransferMode, "#8"); Assert.AreEqual("net.pipe", be.Scheme, "#11"); NamedPipeConnectionPoolSettings pool = be.ConnectionPoolSettings; Assert.IsNotNull(pool, "#13"); Assert.AreEqual("default", pool.GroupName, "#14"); Assert.AreEqual(TimeSpan.FromSeconds(120), pool.IdleTimeout, "#15"); Assert.AreEqual(10, pool.MaxOutboundConnectionsPerEndpoint, "#17"); }