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
- VectorAnimation.cs
- MsmqIntegrationSecurityElement.cs
- LicFileLicenseProvider.cs
- PrimitiveXmlSerializers.cs
- PathFigure.cs
- IndexedGlyphRun.cs
- AssociationSetEnd.cs
- WinCategoryAttribute.cs
- CodeNamespace.cs
- InstanceKeyCompleteException.cs
- FixedSOMSemanticBox.cs
- PeerName.cs
- WebServiceMethodData.cs
- HttpRequestWrapper.cs
- ProviderMetadata.cs
- CDSCollectionETWBCLProvider.cs
- ButtonRenderer.cs
- XmlAttributeAttribute.cs
- login.cs
- SelectorAutomationPeer.cs
- MessageSecurityVersion.cs
- PageThemeParser.cs
- BindingExpressionUncommonField.cs
- GroupItemAutomationPeer.cs
- ItemAutomationPeer.cs
- File.cs
- SiteMembershipCondition.cs
- BaseDataListComponentEditor.cs
- RegisteredHiddenField.cs
- Transactions.cs
- SpecialTypeDataContract.cs
- ListViewInsertionMark.cs
- Attributes.cs
- CodeGeneratorOptions.cs
- OverflowException.cs
- BamlVersionHeader.cs
- ConfigurationManagerHelperFactory.cs
- SqlCommand.cs
- MemoryMappedFile.cs
- RoleManagerModule.cs
- LocalValueEnumerator.cs
- LoginUtil.cs
- IndexedDataBuffer.cs
- CrossContextChannel.cs
- SqlUtils.cs
- WindowsImpersonationContext.cs
- InvalidateEvent.cs
- SystemIPAddressInformation.cs
- StreamUpdate.cs
- ScaleTransform3D.cs
- FaultPropagationRecord.cs
- ConnectionInterfaceCollection.cs
- ItemMap.cs
- ClientSettingsProvider.cs
- ACL.cs
- DataSourceUtil.cs
- PixelFormat.cs
- SqlBooleanizer.cs
- StringBuilder.cs
- InputLangChangeRequestEvent.cs
- MatrixTransform3D.cs
- BooleanProjectedSlot.cs
- MaskDesignerDialog.cs
- Repeater.cs
- FormViewModeEventArgs.cs
- HttpStreams.cs
- HitTestWithPointDrawingContextWalker.cs
- CommentAction.cs
- Update.cs
- DetailsViewInsertedEventArgs.cs
- ExpandSegmentCollection.cs
- MetadataStore.cs
- TextCompositionEventArgs.cs
- ExportException.cs
- SafeWaitHandle.cs
- MergablePropertyAttribute.cs
- MTConfigUtil.cs
- COM2Properties.cs
- BitmapEffectInput.cs
- DataObjectSettingDataEventArgs.cs
- XmlComplianceUtil.cs
- SoapAttributeAttribute.cs
- AdRotator.cs
- XmlKeywords.cs
- contentDescriptor.cs
- SystemTcpConnection.cs
- ResourceReferenceExpression.cs
- ConfigurationValue.cs
- BamlBinaryReader.cs
- SystemIPv6InterfaceProperties.cs
- JapaneseLunisolarCalendar.cs
- AnnotationComponentManager.cs
- IndexerNameAttribute.cs
- StylesEditorDialog.cs
- EmptyEnumerator.cs
- CodeStatement.cs
- EventManager.cs
- InheritedPropertyChangedEventArgs.cs
- BitmapData.cs
- Decoder.cs