Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / ChannelPoolSettings.cs / 1 / ChannelPoolSettings.cs
//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------
namespace System.ServiceModel.Channels
{
using System.Collections.Generic;
using System.ServiceModel;
using System.Runtime.Serialization;
using System.Xml;
using System.ServiceModel.Description;
using System.ServiceModel.Security;
public class ChannelPoolSettings
{
TimeSpan idleTimeout;
TimeSpan leaseTimeout;
int maxOutboundChannelsPerEndpoint;
public ChannelPoolSettings()
{
this.idleTimeout = OneWayDefaults.IdleTimeout;
this.leaseTimeout = OneWayDefaults.LeaseTimeout;
this.maxOutboundChannelsPerEndpoint = OneWayDefaults.MaxOutboundChannelsPerEndpoint;
}
ChannelPoolSettings(ChannelPoolSettings poolToBeCloned)
{
this.idleTimeout = poolToBeCloned.idleTimeout;
this.leaseTimeout = poolToBeCloned.leaseTimeout;
this.maxOutboundChannelsPerEndpoint = poolToBeCloned.maxOutboundChannelsPerEndpoint;
}
public TimeSpan IdleTimeout
{
get
{
return this.idleTimeout;
}
set
{
if (value < TimeSpan.Zero)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value,
SR.GetString(SR.SFxTimeoutOutOfRange0)));
}
if (TimeoutHelper.IsTooLarge(value))
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value,
SR.GetString(SR.SFxTimeoutOutOfRangeTooBig)));
}
this.idleTimeout = value;
}
}
public TimeSpan LeaseTimeout
{
get
{
return leaseTimeout;
}
set
{
if (value < TimeSpan.Zero)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value,
SR.GetString(SR.SFxTimeoutOutOfRange0)));
}
if (TimeoutHelper.IsTooLarge(value))
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value,
SR.GetString(SR.SFxTimeoutOutOfRangeTooBig)));
}
this.leaseTimeout = value;
}
}
public int MaxOutboundChannelsPerEndpoint
{
get
{
return this.maxOutboundChannelsPerEndpoint;
}
set
{
if (value <= 0)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value,
SR.GetString(SR.ValueMustBePositive)));
}
this.maxOutboundChannelsPerEndpoint = value;
}
}
internal ChannelPoolSettings Clone()
{
return new ChannelPoolSettings(this);
}
internal bool IsMatch(ChannelPoolSettings channelPoolSettings)
{
if (channelPoolSettings == null)
{
return false;
}
if (this.idleTimeout != channelPoolSettings.idleTimeout)
{
return false;
}
if (this.leaseTimeout != channelPoolSettings.leaseTimeout)
{
return false;
}
if (this.maxOutboundChannelsPerEndpoint != channelPoolSettings.maxOutboundChannelsPerEndpoint)
{
return false;
}
return true;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlWrappingReader.cs
- Effect.cs
- XmlTextAttribute.cs
- TemplatedControlDesigner.cs
- SQLInt32Storage.cs
- AssemblyName.cs
- BitmapSource.cs
- DSASignatureDeformatter.cs
- ScriptRegistrationManager.cs
- CompiledQueryCacheEntry.cs
- OpenFileDialog.cs
- DomNameTable.cs
- EnumDataContract.cs
- MouseButton.cs
- BufferedReadStream.cs
- ResourceContainer.cs
- DesignerCalendarAdapter.cs
- SchemaTableColumn.cs
- CodeTypeReference.cs
- DateTimeOffsetAdapter.cs
- NavigatorOutput.cs
- ValueTable.cs
- GradientBrush.cs
- NetworkAddressChange.cs
- SafeProcessHandle.cs
- ImportFileRequest.cs
- TimeoutTimer.cs
- FocusTracker.cs
- CollectionView.cs
- DirectoryLocalQuery.cs
- XPathExpr.cs
- SerializationException.cs
- UnsafeNativeMethods.cs
- Stackframe.cs
- ElementProxy.cs
- SiteOfOriginPart.cs
- NativeMethods.cs
- ElementAtQueryOperator.cs
- PrePrepareMethodAttribute.cs
- StrongNameHelpers.cs
- RegexParser.cs
- RsaSecurityTokenAuthenticator.cs
- ProfilePropertySettingsCollection.cs
- ScrollableControl.cs
- SqlFacetAttribute.cs
- DropShadowBitmapEffect.cs
- SmtpReplyReaderFactory.cs
- HostedHttpContext.cs
- DecimalStorage.cs
- NativeMethods.cs
- CatalogZoneBase.cs
- FontWeight.cs
- FontConverter.cs
- _Semaphore.cs
- FormCollection.cs
- HybridDictionary.cs
- BitmapPalette.cs
- MDIWindowDialog.cs
- ArglessEventHandlerProxy.cs
- DocumentCollection.cs
- DES.cs
- DataGrid.cs
- ViewStateException.cs
- LightweightCodeGenerator.cs
- DBDataPermission.cs
- SqlFunctionAttribute.cs
- CompositeClientFormatter.cs
- ErrorFormatterPage.cs
- PageEventArgs.cs
- Color.cs
- ItemAutomationPeer.cs
- ValueTypeFieldReference.cs
- FragmentNavigationEventArgs.cs
- XmlNodeReader.cs
- TextView.cs
- MappingModelBuildProvider.cs
- SizeIndependentAnimationStorage.cs
- ObjectPersistData.cs
- ProfileProvider.cs
- ParserContext.cs
- SQLGuidStorage.cs
- HealthMonitoringSectionHelper.cs
- Win32.cs
- DetailsViewInsertEventArgs.cs
- RegexGroupCollection.cs
- Point3DValueSerializer.cs
- ObjectStateFormatter.cs
- XmlAttributes.cs
- SrgsItemList.cs
- BooleanConverter.cs
- Calendar.cs
- ControlTemplate.cs
- GcSettings.cs
- CheckPair.cs
- TextTreeRootTextBlock.cs
- Symbol.cs
- HttpVersion.cs
- QilLiteral.cs
- LinearQuaternionKeyFrame.cs
- WindowPattern.cs