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
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RepeatButtonAutomationPeer.cs
- JsonServiceDocumentSerializer.cs
- LicenseException.cs
- CodeTypeMember.cs
- XmlEncoding.cs
- EntitySqlException.cs
- RelatedEnd.cs
- Int32Rect.cs
- cookie.cs
- GeometryCollection.cs
- DBCommand.cs
- SamlAuthenticationStatement.cs
- OrderByQueryOptionExpression.cs
- UriTemplateCompoundPathSegment.cs
- ToolStripStatusLabel.cs
- Visual.cs
- URI.cs
- DPTypeDescriptorContext.cs
- RbTree.cs
- ConfigXmlSignificantWhitespace.cs
- PrintDialogDesigner.cs
- RecordsAffectedEventArgs.cs
- SystemException.cs
- ThaiBuddhistCalendar.cs
- RepeaterItemCollection.cs
- glyphs.cs
- FixedHighlight.cs
- SR.cs
- errorpatternmatcher.cs
- AccessText.cs
- TreeNodeStyle.cs
- ListSortDescription.cs
- ProfilePropertyNameValidator.cs
- FillBehavior.cs
- DataGridViewCellCollection.cs
- WindowsButton.cs
- CompareInfo.cs
- XsdValidatingReader.cs
- ButtonFieldBase.cs
- DeviceFilterEditorDialog.cs
- TaskScheduler.cs
- DesignBindingConverter.cs
- CursorInteropHelper.cs
- SapiGrammar.cs
- XsdDataContractImporter.cs
- BCLDebug.cs
- MatchingStyle.cs
- DesignerHost.cs
- DataGridViewRowCancelEventArgs.cs
- SchemaImporterExtensionsSection.cs
- QilExpression.cs
- MatrixValueSerializer.cs
- BaseCodePageEncoding.cs
- TablePattern.cs
- TitleStyle.cs
- PropertyCollection.cs
- CodeAssignStatement.cs
- SafeLocalMemHandle.cs
- AsyncPostBackTrigger.cs
- ScriptManager.cs
- NamespaceInfo.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- GridViewColumn.cs
- DynamicPropertyReader.cs
- QueryInterceptorAttribute.cs
- UriTemplateHelpers.cs
- PlatformCulture.cs
- QilLiteral.cs
- Encoder.cs
- SerialPinChanges.cs
- FrameSecurityDescriptor.cs
- MinMaxParagraphWidth.cs
- ImageConverter.cs
- XmlSiteMapProvider.cs
- InputLanguageManager.cs
- ViewKeyConstraint.cs
- DataSourceViewSchemaConverter.cs
- Rectangle.cs
- BamlRecords.cs
- ExpressionLexer.cs
- ScriptModule.cs
- CodeSnippetExpression.cs
- SafeCancelMibChangeNotify.cs
- FontClient.cs
- Instrumentation.cs
- ELinqQueryState.cs
- WpfPayload.cs
- DebuggerService.cs
- DrawingBrush.cs
- SortDescriptionCollection.cs
- TraceHandlerErrorFormatter.cs
- ConfigurationValues.cs
- XmlAttributeOverrides.cs
- WinFormsUtils.cs
- ExpressionTable.cs
- ServiceThrottle.cs
- NotifyIcon.cs
- TextWriterEngine.cs
- CategoryList.cs
- UIAgentMonitorHandle.cs