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
- ObjectConverter.cs
- ZeroOpNode.cs
- FixedSOMElement.cs
- Globals.cs
- Zone.cs
- ResXResourceWriter.cs
- SqlTopReducer.cs
- WebPartConnectionsCloseVerb.cs
- Image.cs
- ExpressionPrinter.cs
- TreeView.cs
- MultiplexingFormatMapping.cs
- OutputCacheModule.cs
- grammarelement.cs
- TrustSection.cs
- ArrayWithOffset.cs
- RawStylusInputCustomData.cs
- SqlUtils.cs
- ProcessRequestAsyncResult.cs
- _HeaderInfoTable.cs
- FixedFlowMap.cs
- ArrangedElement.cs
- AxHost.cs
- XmlChildNodes.cs
- WebPartZone.cs
- DeviceContext2.cs
- IndexingContentUnit.cs
- AVElementHelper.cs
- TypeHelper.cs
- InfoCardClaim.cs
- metadatamappinghashervisitor.cs
- CancelRequestedQuery.cs
- _LoggingObject.cs
- ZipIOBlockManager.cs
- XDeferredAxisSource.cs
- StagingAreaInputItem.cs
- ReferentialConstraint.cs
- TimeoutValidationAttribute.cs
- XmlWriterDelegator.cs
- SqlClientWrapperSmiStreamChars.cs
- ToolStripButton.cs
- errorpatternmatcher.cs
- Logging.cs
- BitmapMetadataEnumerator.cs
- RequestCacheManager.cs
- WebPartTracker.cs
- SystemIPAddressInformation.cs
- WsatTransactionFormatter.cs
- ConnectionStringsExpressionEditor.cs
- InkCollectionBehavior.cs
- NewArrayExpression.cs
- TreeNodeConverter.cs
- CodeDomExtensionMethods.cs
- ByteStreamMessage.cs
- FormsIdentity.cs
- XmlEntity.cs
- XmlDocumentViewSchema.cs
- EventEntry.cs
- WindowsTreeView.cs
- MessageEventSubscriptionService.cs
- DateTimeOffset.cs
- RuntimeConfig.cs
- TreeViewImageGenerator.cs
- SoapInteropTypes.cs
- BitmapVisualManager.cs
- EntitySqlQueryCacheEntry.cs
- ParseNumbers.cs
- ProxyFragment.cs
- Int16.cs
- AlignmentXValidation.cs
- ResXResourceReader.cs
- HttpCookieCollection.cs
- EventLogPermissionAttribute.cs
- SingleSelectRootGridEntry.cs
- MessageQueuePermission.cs
- ApplicationGesture.cs
- NativeMethodsCLR.cs
- XmlSchemaExternal.cs
- ChangeProcessor.cs
- ApplicationContext.cs
- Binding.cs
- ContentPlaceHolder.cs
- DBCommand.cs
- ValidationEventArgs.cs
- DataKey.cs
- SoapFaultCodes.cs
- SessionStateUtil.cs
- XmlSiteMapProvider.cs
- AssertUtility.cs
- CompiledQuery.cs
- QueuePathEditor.cs
- Stylus.cs
- RouteValueDictionary.cs
- MemberNameValidator.cs
- FormsAuthentication.cs
- XPathParser.cs
- QueryParameter.cs
- TransferMode.cs
- FileDialogCustomPlaces.cs
- TransformedBitmap.cs