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
- AndCondition.cs
- DefaultValueAttribute.cs
- XmlBindingWorker.cs
- InstanceOwnerException.cs
- DependencyPropertyHelper.cs
- mda.cs
- ExternalCalls.cs
- DiscoveryVersionConverter.cs
- XsdBuildProvider.cs
- GridViewColumn.cs
- SettingsContext.cs
- SrgsNameValueTag.cs
- SurrogateSelector.cs
- NullReferenceException.cs
- SnapshotChangeTrackingStrategy.cs
- InputReport.cs
- EventProvider.cs
- PresentationSource.cs
- PathFigureCollection.cs
- FocusManager.cs
- HtmlForm.cs
- DecoderExceptionFallback.cs
- BaseAsyncResult.cs
- UserUseLicenseDictionaryLoader.cs
- XmlUtilWriter.cs
- WebPartsPersonalization.cs
- WebPartEventArgs.cs
- Transform.cs
- Vector3DValueSerializer.cs
- MetadataUtilsSmi.cs
- Literal.cs
- EncryptedKeyIdentifierClause.cs
- SelectionChangedEventArgs.cs
- CompiledELinqQueryState.cs
- ListViewHitTestInfo.cs
- RequiredFieldValidator.cs
- LinkedResource.cs
- AttributeCollection.cs
- Camera.cs
- XPathNavigator.cs
- HtmlProps.cs
- SchemaMapping.cs
- FacetChecker.cs
- ButtonChrome.cs
- ProfileSettings.cs
- HtmlTableCell.cs
- AsymmetricKeyExchangeDeformatter.cs
- GeometryValueSerializer.cs
- ButtonStandardAdapter.cs
- TemplateBindingExpressionConverter.cs
- dbenumerator.cs
- PrintPreviewDialog.cs
- PropertyDescriptor.cs
- ListDesigner.cs
- FocusChangedEventArgs.cs
- WindowsHyperlink.cs
- DataGridRow.cs
- TryLoadRunnableWorkflowCommand.cs
- SiteMapProvider.cs
- XmlObjectSerializerReadContextComplex.cs
- StringToken.cs
- PackageRelationship.cs
- ThreadAttributes.cs
- DocumentOrderQuery.cs
- TableRowGroupCollection.cs
- NavigationEventArgs.cs
- IQueryable.cs
- DataGridTableCollection.cs
- Size3DValueSerializer.cs
- MD5.cs
- EventDescriptor.cs
- DelayedRegex.cs
- WebHttpSecurityModeHelper.cs
- ImmComposition.cs
- BoundField.cs
- ErrorTableItemStyle.cs
- MethodBuilderInstantiation.cs
- MultipartIdentifier.cs
- UnsignedPublishLicense.cs
- WebPartEventArgs.cs
- PropertyInfoSet.cs
- SafeEventLogReadHandle.cs
- InternalException.cs
- XmlTextReaderImplHelpers.cs
- ObjectDataSourceSelectingEventArgs.cs
- StringExpressionSet.cs
- MenuItemCollectionEditorDialog.cs
- SchemaImporterExtensionsSection.cs
- WebPartVerb.cs
- VerticalAlignConverter.cs
- BindingFormattingDialog.cs
- OLEDB_Enum.cs
- CompModSwitches.cs
- XamlParser.cs
- InertiaTranslationBehavior.cs
- TreeViewEvent.cs
- SafeLibraryHandle.cs
- XmlHierarchicalDataSourceView.cs
- DocumentScope.cs
- EntityDataSourceValidationException.cs