Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Channels / OutputChannel.cs / 1 / OutputChannel.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Channels { using System.Collections.Generic; using System.ServiceModel; using System.Diagnostics; using System.ServiceModel.Diagnostics; abstract class OutputChannel : ChannelBase, IOutputChannel { protected OutputChannel(ChannelManagerBase manager) : base(manager) { } public abstract EndpointAddress RemoteAddress { get; } public abstract Uri Via { get; } public IAsyncResult BeginSend(Message message, AsyncCallback callback, object state) { return this.BeginSend(message, this.DefaultSendTimeout, callback, state); } public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) { if (message == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("message"); if (timeout < TimeSpan.Zero) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError( new ArgumentOutOfRangeException("timeout", timeout, SR.GetString(SR.SFxTimeoutOutOfRange0))); ThrowIfDisposedOrNotOpen(); AddHeadersTo(message); this.EmitTrace(message); return OnBeginSend(message, timeout, callback, state); } public void EndSend(IAsyncResult result) { OnEndSend(result); } public override T GetProperty() { if (typeof(T) == typeof(IOutputChannel)) { return (T)(object)this; } T baseProperty = base.GetProperty (); if (baseProperty != null) { return baseProperty; } return default(T); } protected abstract void OnSend(Message message, TimeSpan timeout); protected abstract IAsyncResult OnBeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state); protected abstract void OnEndSend(IAsyncResult result); public void Send(Message message) { this.Send(message, this.DefaultSendTimeout); } public void Send(Message message, TimeSpan timeout) { if (message == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("message"); if (timeout < TimeSpan.Zero) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError( new ArgumentOutOfRangeException("timeout", timeout, SR.GetString(SR.SFxTimeoutOutOfRange0))); ThrowIfDisposedOrNotOpen(); AddHeadersTo(message); this.EmitTrace(message); OnSend(message, timeout); } protected virtual TraceRecord CreateSendTrace(Message message) { return MessageTransmitTraceRecord.CreateSendTraceRecord(message, this.RemoteAddress); } void EmitTrace(Message message) { if (DiagnosticUtility.ShouldTraceInformation) { TraceUtility.TraceEvent(TraceEventType.Information, TraceCode.MessageSent, this.CreateSendTrace(message), this, null); } } protected virtual void AddHeadersTo(Message message) { } } } // 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
- TextEvent.cs
- QuotaThrottle.cs
- XmlSerializationWriter.cs
- WebPartCollection.cs
- FastEncoderWindow.cs
- RIPEMD160.cs
- WebPartConnectionsCancelEventArgs.cs
- Timer.cs
- NonParentingControl.cs
- SerialPort.cs
- DelegateHelpers.Generated.cs
- ReflectionHelper.cs
- EnumerableRowCollection.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- NegationPusher.cs
- XhtmlConformanceSection.cs
- VoiceSynthesis.cs
- SafeSecurityHelper.cs
- FormsIdentity.cs
- ObjectHandle.cs
- ExclusiveCanonicalizationTransform.cs
- SqlConnectionHelper.cs
- safePerfProviderHandle.cs
- SqlParameter.cs
- SchemaImporterExtensionElementCollection.cs
- SaveFileDialog.cs
- AffineTransform3D.cs
- TypeProvider.cs
- BooleanFacetDescriptionElement.cs
- Brush.cs
- SimpleLine.cs
- addressfiltermode.cs
- WebScriptClientGenerator.cs
- storepermission.cs
- TreeNodeEventArgs.cs
- MarginsConverter.cs
- StaticSiteMapProvider.cs
- XmlSchemaComplexContentExtension.cs
- XmlSchemaAttributeGroup.cs
- DataGridViewCellParsingEventArgs.cs
- SafeCancelMibChangeNotify.cs
- XPathNodePointer.cs
- HttpProfileBase.cs
- NumberSubstitution.cs
- TextModifierScope.cs
- XmlComment.cs
- RenderingBiasValidation.cs
- BooleanKeyFrameCollection.cs
- X509WindowsSecurityToken.cs
- NetCodeGroup.cs
- DataSourceSelectArguments.cs
- DataKey.cs
- ObjectTokenCategory.cs
- TouchesCapturedWithinProperty.cs
- AccessKeyManager.cs
- SecUtil.cs
- PermissionAttributes.cs
- WindowsListViewItemCheckBox.cs
- HttpHandlersInstallComponent.cs
- ChannelManager.cs
- DataSourceControlBuilder.cs
- UniqueSet.cs
- IUnknownConstantAttribute.cs
- EntityContainerRelationshipSetEnd.cs
- SafeNativeMethods.cs
- ContractComponent.cs
- ApplicationHost.cs
- IsolatedStorageException.cs
- CredentialCache.cs
- Types.cs
- CountdownEvent.cs
- Point.cs
- KerberosSecurityTokenProvider.cs
- Type.cs
- TreePrinter.cs
- XmlException.cs
- InboundActivityHelper.cs
- Matrix3D.cs
- RetrieveVirtualItemEventArgs.cs
- ItemCollection.cs
- WeakReferenceEnumerator.cs
- ProfilePropertySettingsCollection.cs
- FileRegion.cs
- BoolExpressionVisitors.cs
- unsafenativemethodsother.cs
- ListenerConnectionDemuxer.cs
- MappingModelBuildProvider.cs
- HttpHandlersInstallComponent.cs
- LifetimeServices.cs
- MethodExpr.cs
- AncillaryOps.cs
- TemplateModeChangedEventArgs.cs
- PrinterResolution.cs
- UpDownBase.cs
- StrokeDescriptor.cs
- StrokeCollectionDefaultValueFactory.cs
- TransactionFlowOption.cs
- LayoutEngine.cs
- ServiceDescriptionImporter.cs
- HttpListenerRequestUriBuilder.cs