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
- ServicePointManager.cs
- HttpGetProtocolImporter.cs
- StreamGeometry.cs
- GridViewCancelEditEventArgs.cs
- SimpleParser.cs
- ObjectSelectorEditor.cs
- WebPartDisplayModeEventArgs.cs
- EditingMode.cs
- HotSpot.cs
- CheckoutException.cs
- ClientSettingsStore.cs
- WebPartActionVerb.cs
- SecUtil.cs
- DynamicObject.cs
- DataGridViewTextBoxEditingControl.cs
- FastPropertyAccessor.cs
- XmlDataProvider.cs
- FixedTextView.cs
- ApplicationException.cs
- BitVector32.cs
- OutputCacheSettings.cs
- DiscreteKeyFrames.cs
- RepeatInfo.cs
- SessionStateModule.cs
- Byte.cs
- ClientSettingsStore.cs
- MemberInitExpression.cs
- RangeBase.cs
- DataGridViewRowConverter.cs
- CanExecuteRoutedEventArgs.cs
- StaticDataManager.cs
- ReferencedType.cs
- IDReferencePropertyAttribute.cs
- TableAutomationPeer.cs
- DbModificationCommandTree.cs
- FrameworkElementFactory.cs
- brushes.cs
- UrlMappingCollection.cs
- SoapReflectionImporter.cs
- CalendarDayButton.cs
- ButtonRenderer.cs
- AuthenticationManager.cs
- ScopeElement.cs
- LineBreak.cs
- DoubleAverageAggregationOperator.cs
- OSEnvironmentHelper.cs
- EventlogProvider.cs
- WorkflowOperationFault.cs
- SrgsGrammarCompiler.cs
- Authorization.cs
- NamespaceTable.cs
- ScriptReferenceBase.cs
- Error.cs
- ControlAdapter.cs
- OleDbConnection.cs
- CompiledQuery.cs
- ByteViewer.cs
- HeaderedContentControl.cs
- LinqDataSourceDisposeEventArgs.cs
- ProfileInfo.cs
- CaseInsensitiveOrdinalStringComparer.cs
- SemanticResultKey.cs
- CalendarDateRange.cs
- WindowHideOrCloseTracker.cs
- AuthenticationServiceManager.cs
- XslNumber.cs
- ListCardsInFileRequest.cs
- MemoryMappedFileSecurity.cs
- HiddenFieldPageStatePersister.cs
- ComplusEndpointConfigContainer.cs
- TrustManagerPromptUI.cs
- TimeSpanConverter.cs
- CallContext.cs
- Internal.cs
- CacheAxisQuery.cs
- Matrix3D.cs
- DataServiceRequest.cs
- AssemblyCollection.cs
- BinHexDecoder.cs
- CancelRequestedQuery.cs
- InputElement.cs
- DateTimeFormatInfo.cs
- LoginView.cs
- peernodestatemanager.cs
- CapabilitiesAssignment.cs
- BulletDecorator.cs
- PackagingUtilities.cs
- SizeChangedEventArgs.cs
- CodeTypeMemberCollection.cs
- Crc32Helper.cs
- Positioning.cs
- PrimitiveCodeDomSerializer.cs
- StateDesignerConnector.cs
- TagNameToTypeMapper.cs
- SiteIdentityPermission.cs
- WebPartTransformerCollection.cs
- WorkflowRuntime.cs
- Win32MouseDevice.cs
- CodeExporter.cs
- PackWebResponse.cs