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
- BStrWrapper.cs
- LocalizableAttribute.cs
- IntPtr.cs
- OneOfTypeConst.cs
- QualifiedCellIdBoolean.cs
- CachedPathData.cs
- MDIWindowDialog.cs
- HijriCalendar.cs
- DisableDpiAwarenessAttribute.cs
- WebPartCatalogCloseVerb.cs
- PageBreakRecord.cs
- KnownTypes.cs
- ObjectRef.cs
- PropertyInformation.cs
- WebPartUserCapability.cs
- MruCache.cs
- EditingCoordinator.cs
- UserNamePasswordValidator.cs
- MembershipPasswordException.cs
- cookiecollection.cs
- SiteMap.cs
- WebPartUserCapability.cs
- UnsettableComboBox.cs
- ColorTransformHelper.cs
- SqlBuffer.cs
- ParallelLoopState.cs
- RegexNode.cs
- QilTargetType.cs
- Behavior.cs
- JsonStringDataContract.cs
- SoapSchemaExporter.cs
- RoutingUtilities.cs
- OletxEnlistment.cs
- PersistenceTypeAttribute.cs
- ScrollViewer.cs
- DynamicField.cs
- RawContentTypeMapper.cs
- TextHidden.cs
- Bidi.cs
- TemplateBamlRecordReader.cs
- ChannelListenerBase.cs
- ProcessModelSection.cs
- UdpChannelListener.cs
- MiniMapControl.xaml.cs
- ArcSegment.cs
- PrinterResolution.cs
- TdsValueSetter.cs
- Expressions.cs
- ReliableDuplexSessionChannel.cs
- UnaryOperationBinder.cs
- PeerNameRegistration.cs
- StreamReader.cs
- PermissionRequestEvidence.cs
- Positioning.cs
- XmlSchemaSimpleTypeList.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- SafeRightsManagementPubHandle.cs
- DataTableReaderListener.cs
- ColumnResizeUndoUnit.cs
- ListViewEditEventArgs.cs
- XPathSelfQuery.cs
- PageRequestManager.cs
- xml.cs
- MarkupObject.cs
- OleDbParameter.cs
- TreeNodeEventArgs.cs
- SwitchLevelAttribute.cs
- DataGridViewTopRowAccessibleObject.cs
- TypeInfo.cs
- WSFederationHttpSecurityElement.cs
- CodeDirectoryCompiler.cs
- PropertyValueChangedEvent.cs
- DetailsViewPageEventArgs.cs
- RightsManagementInformation.cs
- DataSourceDescriptorCollection.cs
- WebServiceHost.cs
- DbFunctionCommandTree.cs
- wgx_sdk_version.cs
- WebEventTraceProvider.cs
- HtmlControlPersistable.cs
- XmlElement.cs
- CheckBoxAutomationPeer.cs
- ConfigXmlSignificantWhitespace.cs
- WebPartMinimizeVerb.cs
- ImageConverter.cs
- DataContractSerializer.cs
- FileDataSourceCache.cs
- X509WindowsSecurityToken.cs
- TemplateBindingExtension.cs
- ConstantProjectedSlot.cs
- XmlCDATASection.cs
- CreateUserWizard.cs
- XmlLinkedNode.cs
- ConnectionString.cs
- Focus.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- RewritingPass.cs
- MethodToken.cs
- VBCodeProvider.cs
- WebFaultClientMessageInspector.cs