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
- SemanticValue.cs
- TreeViewDesigner.cs
- GradientStop.cs
- TreeNodeCollectionEditorDialog.cs
- DocumentViewer.cs
- DataGridViewComboBoxColumnDesigner.cs
- SchemaImporter.cs
- NavigateUrlConverter.cs
- FixedTextView.cs
- WebPartDeleteVerb.cs
- HandleValueEditor.cs
- LayoutExceptionEventArgs.cs
- LocalBuilder.cs
- JsonServiceDocumentSerializer.cs
- SafeNativeMethodsOther.cs
- PermissionSetTriple.cs
- WebDescriptionAttribute.cs
- Tile.cs
- OracleConnection.cs
- IncrementalReadDecoders.cs
- AudioSignalProblemOccurredEventArgs.cs
- StyleModeStack.cs
- MappingItemCollection.cs
- XmlCompatibilityReader.cs
- ArglessEventHandlerProxy.cs
- ReachSerializableProperties.cs
- FirstMatchCodeGroup.cs
- RijndaelManaged.cs
- QilPatternFactory.cs
- ZeroOpNode.cs
- FormViewRow.cs
- VariableQuery.cs
- StrokeRenderer.cs
- TableLayoutStyle.cs
- DefaultTextStoreTextComposition.cs
- HttpVersion.cs
- IApplicationTrustManager.cs
- ThemeInfoAttribute.cs
- Attributes.cs
- TypeDescriptionProvider.cs
- BindingNavigator.cs
- CellRelation.cs
- WhiteSpaceTrimStringConverter.cs
- ClientTarget.cs
- UrlMappingCollection.cs
- TargetConverter.cs
- ChannelCacheDefaults.cs
- GlobalizationAssembly.cs
- ProcessHostFactoryHelper.cs
- InternalBase.cs
- HttpWebRequestElement.cs
- DataKeyPropertyAttribute.cs
- NotifyIcon.cs
- ViewPort3D.cs
- SecUtil.cs
- EventDescriptor.cs
- TextLineBreak.cs
- Wildcard.cs
- AxHostDesigner.cs
- GCHandleCookieTable.cs
- QueryOpcode.cs
- ContextMenu.cs
- Help.cs
- ExpandSegment.cs
- PropertyMappingExceptionEventArgs.cs
- InputProviderSite.cs
- ServiceSecurityContext.cs
- TextFragmentEngine.cs
- HttpCacheVaryByContentEncodings.cs
- DataPointer.cs
- Pen.cs
- CharacterBufferReference.cs
- FixedBufferAttribute.cs
- DataServiceContext.cs
- DataException.cs
- RegularExpressionValidator.cs
- AppModelKnownContentFactory.cs
- CodeRemoveEventStatement.cs
- BitmapMetadata.cs
- AnnotationResourceChangedEventArgs.cs
- UrlPath.cs
- TextRangeEdit.cs
- IteratorFilter.cs
- ProcessHostServerConfig.cs
- TextInfo.cs
- SigningCredentials.cs
- DefaultBindingPropertyAttribute.cs
- ScrollViewerAutomationPeer.cs
- TextClipboardData.cs
- FlowSwitch.cs
- TextRange.cs
- MessageQueueEnumerator.cs
- ScanQueryOperator.cs
- FixedSOMGroup.cs
- ActivityCodeDomSerializer.cs
- ReadWriteObjectLock.cs
- Geometry.cs
- EventLogPermissionEntryCollection.cs
- WorkflowQueuingService.cs
- DbConnectionPoolCounters.cs