Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / TcpConnectionPool.cs / 1 / TcpConnectionPool.cs
//----------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//---------------------------------------------------------------------------
namespace System.ServiceModel.Channels
{
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Net;
using System.Net.Sockets;
using System.Globalization;
using System.ServiceModel.Diagnostics;
class TcpConnectionPoolRegistry : ConnectionPoolRegistry
{
public TcpConnectionPoolRegistry()
: base()
{
}
protected override ConnectionPool CreatePool(IConnectionOrientedTransportChannelFactorySettings settings)
{
ITcpChannelFactorySettings tcpSettings = (ITcpChannelFactorySettings)settings;
return new TcpConnectionPool(tcpSettings);
}
class TcpConnectionPool : ConnectionPool
{
public TcpConnectionPool(ITcpChannelFactorySettings settings)
: base(settings, settings.LeaseTimeout)
{
}
protected override string GetPoolKey(EndpointAddress address, Uri via)
{
int port = via.Port;
if (port == -1)
{
port = TcpUri.DefaultPort;
}
string normalizedHost = via.DnsSafeHost.ToUpperInvariant();
return string.Format(CultureInfo.InvariantCulture, @"[{0}, {1}]", normalizedHost, port);
}
public override bool IsCompatible(IConnectionOrientedTransportChannelFactorySettings settings)
{
ITcpChannelFactorySettings tcpSettings = (ITcpChannelFactorySettings)settings;
return (
(this.LeaseTimeout == tcpSettings.LeaseTimeout) &&
base.IsCompatible(settings)
);
}
}
}
}
// 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
- EntityDataReader.cs
- HtmlInputRadioButton.cs
- COM2ExtendedUITypeEditor.cs
- TTSEngineProxy.cs
- ToolboxItemSnapLineBehavior.cs
- AstNode.cs
- ToolStripPanelCell.cs
- OleStrCAMarshaler.cs
- TextFindEngine.cs
- DocumentViewerConstants.cs
- TypeSystem.cs
- ScrollData.cs
- PageCache.cs
- XmlNotation.cs
- QilList.cs
- CustomCredentialPolicy.cs
- Rfc2898DeriveBytes.cs
- Brush.cs
- TypeHelper.cs
- InitializerFacet.cs
- IsolatedStorageFilePermission.cs
- Attribute.cs
- ChannelSinkStacks.cs
- GZipDecoder.cs
- ParentQuery.cs
- XmlResolver.cs
- MimeXmlImporter.cs
- ScrollableControl.cs
- FtpWebResponse.cs
- TcpClientChannel.cs
- CalendarAutoFormatDialog.cs
- WorkflowOwnershipException.cs
- URIFormatException.cs
- MembershipValidatePasswordEventArgs.cs
- KeyTime.cs
- TaiwanLunisolarCalendar.cs
- CustomAttribute.cs
- PointAnimationUsingKeyFrames.cs
- Funcletizer.cs
- SHA512CryptoServiceProvider.cs
- NullNotAllowedCollection.cs
- ImageDrawing.cs
- SourceSwitch.cs
- ScopelessEnumAttribute.cs
- PresentationSource.cs
- DataGridViewImageColumn.cs
- PropertyMap.cs
- Matrix.cs
- DataObjectEventArgs.cs
- PeerContact.cs
- Mouse.cs
- DataSourceXmlSubItemAttribute.cs
- XhtmlBasicPhoneCallAdapter.cs
- EditorServiceContext.cs
- TextEditorTables.cs
- SqlRemoveConstantOrderBy.cs
- Sql8ConformanceChecker.cs
- UpdateDelegates.Generated.cs
- TextRangeBase.cs
- ContainerAction.cs
- ListViewItem.cs
- AtomPub10ServiceDocumentFormatter.cs
- HttpCacheParams.cs
- RelatedCurrencyManager.cs
- Rectangle.cs
- ConfigurationStrings.cs
- ScriptBehaviorDescriptor.cs
- ThreadExceptionDialog.cs
- CodeTypeReference.cs
- RegistryPermission.cs
- CorrelationManager.cs
- TriState.cs
- CngProvider.cs
- DataColumnCollection.cs
- FunctionParameter.cs
- XmlDocumentSerializer.cs
- ProcessHostFactoryHelper.cs
- TextLineBreak.cs
- PerspectiveCamera.cs
- DataSourceXmlClassAttribute.cs
- LineInfo.cs
- ContentPosition.cs
- OracleBoolean.cs
- DbDataRecord.cs
- WindowProviderWrapper.cs
- Pool.cs
- PrintEvent.cs
- Point3DAnimationBase.cs
- CalendarDateChangedEventArgs.cs
- WebServiceMethodData.cs
- HtmlTableRow.cs
- DocumentXmlWriter.cs
- TypeCodeDomSerializer.cs
- ArgumentsParser.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- JsonClassDataContract.cs
- CompilerLocalReference.cs
- MetadataException.cs
- Pair.cs
- ResourcePermissionBaseEntry.cs