Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / ChannelBase.cs / 1 / ChannelBase.cs
//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------
namespace System.ServiceModel.Channels
{
using System.Diagnostics;
using System.ServiceModel;
using System.ServiceModel.Diagnostics;
public abstract class ChannelBase : CommunicationObject, IChannel, IDefaultCommunicationTimeouts
{
ChannelManagerBase channelManager;
protected ChannelBase(ChannelManagerBase channelManager)
{
if (channelManager == null)
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("channelManager");
}
this.channelManager = channelManager;
if (DiagnosticUtility.ShouldTraceVerbose)
{
DiagnosticUtility.DiagnosticTrace.TraceEvent(TraceEventType.Verbose, TraceCode.ChannelCreated,
SR.GetString(SR.TraceCodeChannelCreated, DiagnosticTrace.CreateSourceString(this)),
null, null, this);
}
}
TimeSpan IDefaultCommunicationTimeouts.CloseTimeout
{
get { return this.DefaultCloseTimeout; }
}
TimeSpan IDefaultCommunicationTimeouts.OpenTimeout
{
get { return this.DefaultOpenTimeout; }
}
TimeSpan IDefaultCommunicationTimeouts.ReceiveTimeout
{
get { return this.DefaultReceiveTimeout; }
}
TimeSpan IDefaultCommunicationTimeouts.SendTimeout
{
get { return this.DefaultSendTimeout; }
}
protected override TimeSpan DefaultCloseTimeout
{
get { return ((IDefaultCommunicationTimeouts)this.channelManager).CloseTimeout; }
}
protected override TimeSpan DefaultOpenTimeout
{
get { return ((IDefaultCommunicationTimeouts)this.channelManager).OpenTimeout; }
}
protected TimeSpan DefaultReceiveTimeout
{
get { return ((IDefaultCommunicationTimeouts)this.channelManager).ReceiveTimeout; }
}
protected TimeSpan DefaultSendTimeout
{
get { return ((IDefaultCommunicationTimeouts)this.channelManager).SendTimeout; }
}
protected ChannelManagerBase Manager
{
get
{
return channelManager;
}
}
public virtual T GetProperty() where T : class
{
IChannelFactory factory = this.channelManager as IChannelFactory;
if (factory != null)
{
return factory.GetProperty();
}
IChannelListener listener = this.channelManager as IChannelListener;
if (listener != null)
{
return listener.GetProperty();
}
return null;
}
protected override void OnClosed()
{
base.OnClosed();
if (DiagnosticUtility.ShouldTraceVerbose)
{
DiagnosticUtility.DiagnosticTrace.TraceEvent(TraceEventType.Verbose, TraceCode.ChannelDisposed,
SR.GetString(SR.TraceCodeChannelDisposed, DiagnosticTrace.CreateSourceString(this)),
null, null, this);
}
}
}
}
// 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
- xdrvalidator.cs
- GroupItem.cs
- HandlerBase.cs
- EdmProperty.cs
- Metadata.cs
- ViewGenerator.cs
- ConfigurationValidatorAttribute.cs
- TransformGroup.cs
- SimpleHandlerBuildProvider.cs
- DiagnosticSection.cs
- SqlDataSourceFilteringEventArgs.cs
- DataGridViewImageColumn.cs
- WindowsAuthenticationModule.cs
- XmlSchemaSimpleTypeList.cs
- DataSourceCache.cs
- FixedSOMLineRanges.cs
- CreateUserWizard.cs
- SchemaNamespaceManager.cs
- RepeaterItemEventArgs.cs
- DataControlCommands.cs
- PageFunction.cs
- NamespaceInfo.cs
- CatalogPart.cs
- PageWrapper.cs
- IItemContainerGenerator.cs
- SqlDataSourceCommandEventArgs.cs
- TypeConverterMarkupExtension.cs
- SamlAuthenticationStatement.cs
- IncrementalReadDecoders.cs
- GeometryGroup.cs
- XmlSchemaException.cs
- CodePropertyReferenceExpression.cs
- FileIOPermission.cs
- CompilerScope.Storage.cs
- Rfc2898DeriveBytes.cs
- Screen.cs
- EmptyStringExpandableObjectConverter.cs
- TemplateBindingExpression.cs
- RoleGroupCollection.cs
- ParseChildrenAsPropertiesAttribute.cs
- ResumeStoryboard.cs
- InvalidPrinterException.cs
- LocationReferenceValue.cs
- QueryExpr.cs
- StorageBasedPackageProperties.cs
- DataConnectionHelper.cs
- DebugController.cs
- TcpClientSocketManager.cs
- WebConfigurationHost.cs
- InstalledFontCollection.cs
- StringConverter.cs
- RectangleGeometry.cs
- XmlChildEnumerator.cs
- WebExceptionStatus.cs
- IndicShape.cs
- AddInPipelineAttributes.cs
- TailCallAnalyzer.cs
- MobileTemplatedControlDesigner.cs
- DesignerActionUI.cs
- SiteMapSection.cs
- HtmlEncodedRawTextWriter.cs
- Rect3D.cs
- Options.cs
- GridViewUpdatedEventArgs.cs
- KerberosSecurityTokenAuthenticator.cs
- EdmType.cs
- SQLInt32.cs
- ConvertTextFrag.cs
- DtrList.cs
- MetafileHeader.cs
- HttpCacheParams.cs
- FormViewModeEventArgs.cs
- ClientFormsAuthenticationCredentials.cs
- RegexGroup.cs
- SoapSchemaImporter.cs
- CompileLiteralTextParser.cs
- ColorContext.cs
- ListViewAutomationPeer.cs
- ProfileSettings.cs
- WebPartDisplayMode.cs
- DriveNotFoundException.cs
- ToolStripProgressBar.cs
- XmlReturnReader.cs
- SafeCryptoHandles.cs
- ValidatingCollection.cs
- ColorConverter.cs
- SemaphoreFullException.cs
- TemplateField.cs
- TranslateTransform3D.cs
- DataList.cs
- ServiceDescriptionReflector.cs
- KnownAssemblyEntry.cs
- PieceDirectory.cs
- ColumnReorderedEventArgs.cs
- XmlSerializerOperationBehavior.cs
- SharedConnectionListener.cs
- EventRouteFactory.cs
- Parameter.cs
- XmlCompatibilityReader.cs
- DbProviderConfigurationHandler.cs