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
- DataGridItemCollection.cs
- StateItem.cs
- BaseCodePageEncoding.cs
- BitmapEffectDrawingContextState.cs
- NetworkAddressChange.cs
- TdsParserSessionPool.cs
- ScaleTransform3D.cs
- SessionEndingCancelEventArgs.cs
- GroupedContextMenuStrip.cs
- EmbeddedMailObjectsCollection.cs
- LazyTextWriterCreator.cs
- XmlSchemaElement.cs
- LinkTarget.cs
- HttpCachePolicyElement.cs
- CompilationSection.cs
- Point3DCollection.cs
- RegexWriter.cs
- FixedPageStructure.cs
- TypeAccessException.cs
- DataRowView.cs
- PeerCollaboration.cs
- LinkArea.cs
- SchemaSetCompiler.cs
- SectionUpdates.cs
- SHA256Managed.cs
- Win32SafeHandles.cs
- complextypematerializer.cs
- QilExpression.cs
- WizardForm.cs
- TextPenaltyModule.cs
- ReferentialConstraintRoleElement.cs
- PaperSource.cs
- IdentityReference.cs
- ConfigurationFileMap.cs
- WebSysDescriptionAttribute.cs
- XmlSchemaAny.cs
- RewritingSimplifier.cs
- BinaryObjectReader.cs
- AdCreatedEventArgs.cs
- ResourceDescriptionAttribute.cs
- SystemNetworkInterface.cs
- FaultContractAttribute.cs
- RegistrationProxy.cs
- EntityDataSourceView.cs
- SerializationSectionGroup.cs
- TextPattern.cs
- BitmapSizeOptions.cs
- ChtmlPageAdapter.cs
- AppDomainShutdownMonitor.cs
- TransactionScope.cs
- Soap.cs
- ConnectionsZoneAutoFormat.cs
- VectorKeyFrameCollection.cs
- ScriptControlDescriptor.cs
- References.cs
- XmlSchemaInfo.cs
- NullableDoubleMinMaxAggregationOperator.cs
- diagnosticsswitches.cs
- EventProxy.cs
- PointLight.cs
- CompilationRelaxations.cs
- WebContext.cs
- DataSetFieldSchema.cs
- CodeDOMProvider.cs
- BooleanKeyFrameCollection.cs
- ParsedAttributeCollection.cs
- ProgressPage.cs
- MatrixCamera.cs
- CurrentTimeZone.cs
- FillRuleValidation.cs
- DbConnectionStringBuilder.cs
- InputLanguageSource.cs
- SchemaNamespaceManager.cs
- UpDownBaseDesigner.cs
- Binding.cs
- ProfileProvider.cs
- UpdateCommand.cs
- VirtualDirectoryMapping.cs
- FreezableCollection.cs
- XmlUTF8TextReader.cs
- RtType.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- SafePEFileHandle.cs
- CodeMemberMethod.cs
- DBSchemaRow.cs
- CornerRadius.cs
- TypedColumnHandler.cs
- DescendentsWalkerBase.cs
- SizeIndependentAnimationStorage.cs
- TextBoxRenderer.cs
- CompilerHelpers.cs
- CodeSnippetCompileUnit.cs
- DetailsView.cs
- EnumerableRowCollectionExtensions.cs
- DataServiceRequestException.cs
- ScriptingSectionGroup.cs
- BuildResult.cs
- ConnectionString.cs
- WindowInteractionStateTracker.cs
- RefExpr.cs