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
- QuotedStringWriteStateInfo.cs
- ImmComposition.cs
- EditBehavior.cs
- ListParaClient.cs
- RegexWriter.cs
- Accessible.cs
- ParentControlDesigner.cs
- Regex.cs
- PageThemeParser.cs
- ControlSerializer.cs
- ProbeRequestResponseAsyncResult.cs
- ActivityScheduledQuery.cs
- RemotingException.cs
- SelectionProcessor.cs
- SizeKeyFrameCollection.cs
- ListViewInsertionMark.cs
- BinaryFormatter.cs
- Nodes.cs
- ThreadExceptionEvent.cs
- CrossSiteScriptingValidation.cs
- DiagnosticSection.cs
- IisTraceWebEventProvider.cs
- DataRecordObjectView.cs
- Section.cs
- EntitySetBaseCollection.cs
- UntypedNullExpression.cs
- GroupQuery.cs
- HttpCachePolicyWrapper.cs
- ProcessHostFactoryHelper.cs
- RowTypeElement.cs
- ActivationServices.cs
- DataQuery.cs
- SharedUtils.cs
- ConfigurationException.cs
- PointCollectionConverter.cs
- MetafileHeader.cs
- ListManagerBindingsCollection.cs
- AsyncResult.cs
- DynamicQueryableWrapper.cs
- DataGridAddNewRow.cs
- DataGridViewDataConnection.cs
- ConfigXmlAttribute.cs
- PtsPage.cs
- ListViewSelectEventArgs.cs
- ReaderWriterLock.cs
- SamlNameIdentifierClaimResource.cs
- CacheMode.cs
- SharedPersonalizationStateInfo.cs
- Function.cs
- RenderData.cs
- ObjectStateFormatter.cs
- SqlGenericUtil.cs
- InfoCardSymmetricCrypto.cs
- Assert.cs
- panel.cs
- safemediahandle.cs
- DynamicResourceExtension.cs
- WebPartEditorCancelVerb.cs
- SerializationInfoEnumerator.cs
- FormViewPagerRow.cs
- StatusBar.cs
- ExpressionHelper.cs
- BrowserDefinition.cs
- SafeSerializationManager.cs
- CharUnicodeInfo.cs
- WebReferencesBuildProvider.cs
- WindowsAuthenticationEventArgs.cs
- KnownColorTable.cs
- DataGridViewRowsRemovedEventArgs.cs
- MeasureData.cs
- JsonByteArrayDataContract.cs
- TreeNodeBinding.cs
- FileLevelControlBuilderAttribute.cs
- CodeDirectoryCompiler.cs
- ClientSession.cs
- SchemaCompiler.cs
- thaishape.cs
- Rect3D.cs
- NameValueSectionHandler.cs
- IEnumerable.cs
- EditingCoordinator.cs
- AuthenticationSection.cs
- FilePrompt.cs
- ToolStripCollectionEditor.cs
- Unit.cs
- CompiledXpathExpr.cs
- TranslateTransform3D.cs
- Model3DCollection.cs
- FrugalList.cs
- ImageFormat.cs
- VisualBasicSettings.cs
- SafeNativeMethods.cs
- GridSplitterAutomationPeer.cs
- DialogResultConverter.cs
- XhtmlConformanceSection.cs
- ApplicationSecurityInfo.cs
- Facet.cs
- XmlSchemaObjectCollection.cs
- Highlights.cs
- PublisherIdentityPermission.cs