Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / TcpChannelFactory.cs / 1 / TcpChannelFactory.cs
//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------
// Enable this to dump contents of a connection a file.
//#define CONNECTIONDUMP
namespace System.ServiceModel.Channels
{
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Threading;
using System.Runtime.Serialization;
using System.ServiceModel.Diagnostics;
class TcpChannelFactory : ConnectionOrientedTransportChannelFactory,
ITcpChannelFactorySettings
{
static TcpConnectionPoolRegistry connectionPoolRegistry = new TcpConnectionPoolRegistry();
TimeSpan leaseTimeout;
public TcpChannelFactory(TcpTransportBindingElement bindingElement, BindingContext context)
: base(bindingElement, context,
bindingElement.ConnectionPoolSettings.GroupName,
bindingElement.ConnectionPoolSettings.IdleTimeout,
bindingElement.ConnectionPoolSettings.MaxOutboundConnectionsPerEndpoint)
{
this.leaseTimeout = bindingElement.ConnectionPoolSettings.LeaseTimeout;
}
public TimeSpan LeaseTimeout
{
get
{
return leaseTimeout;
}
}
public override string Scheme
{
get { return Uri.UriSchemeNetTcp; }
}
internal override IConnectionInitiator GetConnectionInitiator()
{
IConnectionInitiator socketConnectionInitiator = new SocketConnectionInitiator(
ConnectionBufferSize);
#if CONNECTIONDUMP
socketConnectionInitiator = new ConnectionDumpInitiator(socketConnectionInitiator);
#endif
return new BufferedConnectionInitiator(socketConnectionInitiator,
MaxOutputDelay, ConnectionBufferSize);
}
internal override ConnectionPool GetConnectionPool()
{
return connectionPoolRegistry.Lookup(this);
}
internal override void ReleaseConnectionPool(ConnectionPool pool, TimeSpan timeout)
{
connectionPoolRegistry.Release(pool, timeout);
}
}
}
// 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
- UIElementPropertyUndoUnit.cs
- ObjectToIdCache.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- ElementFactory.cs
- CodeAttributeDeclaration.cs
- odbcmetadatacolumnnames.cs
- BitmapEffect.cs
- TimeIntervalCollection.cs
- XmlSchemaParticle.cs
- WebBrowserContainer.cs
- grammarelement.cs
- TrayIconDesigner.cs
- OdbcCommandBuilder.cs
- Byte.cs
- RecognizerInfo.cs
- ToolbarAUtomationPeer.cs
- XmlSchema.cs
- TimestampInformation.cs
- CodeValidator.cs
- ImpersonationContext.cs
- Token.cs
- ErrorsHelper.cs
- IsolatedStorageFile.cs
- PersonalizationProviderHelper.cs
- ObjectSecurityT.cs
- DataContractSerializerSection.cs
- RichTextBoxContextMenu.cs
- StrongNamePublicKeyBlob.cs
- DataRelationCollection.cs
- TextRangeEdit.cs
- PropertyInfo.cs
- ConfigurationElementProperty.cs
- DbgUtil.cs
- CharacterShapingProperties.cs
- xml.cs
- Trace.cs
- UnsafeNativeMethods.cs
- ClientUrlResolverWrapper.cs
- DataGridViewButtonCell.cs
- TableItemProviderWrapper.cs
- DataGridDesigner.cs
- MultiTrigger.cs
- FormsAuthenticationTicket.cs
- VisualBrush.cs
- PasswordTextNavigator.cs
- Privilege.cs
- LifetimeServices.cs
- HttpHandlersSection.cs
- PersonalizableAttribute.cs
- IdnMapping.cs
- AudioSignalProblemOccurredEventArgs.cs
- FileDetails.cs
- ExpressionConverter.cs
- ProtectedConfiguration.cs
- XsltOutput.cs
- AccessorTable.cs
- MarkupCompiler.cs
- SelectionPatternIdentifiers.cs
- OdbcUtils.cs
- AssemblyAttributesGoHere.cs
- RootProfilePropertySettingsCollection.cs
- DataGridAutoFormatDialog.cs
- GraphicsPathIterator.cs
- UrlAuthFailedErrorFormatter.cs
- GroupJoinQueryOperator.cs
- FrameworkContextData.cs
- CompiledXpathExpr.cs
- ImageCodecInfo.cs
- DesignerOptionService.cs
- SingleTagSectionHandler.cs
- CustomPopupPlacement.cs
- RoutedEventArgs.cs
- XMLSchema.cs
- SqlRowUpdatedEvent.cs
- SecurityRuntime.cs
- ControlTemplate.cs
- IteratorFilter.cs
- LayoutDump.cs
- ClientCultureInfo.cs
- MultiplexingFormatMapping.cs
- Margins.cs
- ApplicationServiceHelper.cs
- EncoderParameters.cs
- CookieHandler.cs
- HMAC.cs
- DataGridRow.cs
- StaticExtension.cs
- RecipientServiceModelSecurityTokenRequirement.cs
- SourceLocation.cs
- FixedSOMTableRow.cs
- ModelMemberCollection.cs
- WebServiceMethodData.cs
- XPathExpr.cs
- StickyNoteContentControl.cs
- RadialGradientBrush.cs
- DiscriminatorMap.cs
- DataGridViewColumnCollectionEditor.cs
- StreamBodyWriter.cs
- EnumerableCollectionView.cs
- XPathScanner.cs