Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Description / CallbackTimeoutsBehavior.cs / 1 / CallbackTimeoutsBehavior.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.ServiceModel.Description { using System.ServiceModel.Channels; using System.ServiceModel; using System.ServiceModel.Dispatcher; using System.Runtime.Serialization; using System.Collections.ObjectModel; using System.Collections.Generic; internal class CallbackTimeoutsBehavior : IEndpointBehavior { TimeSpan transactionTimeout = TimeSpan.Zero; public TimeSpan TransactionTimeout { get { return this.transactionTimeout; } set { if (value < TimeSpan.Zero) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value, SR.GetString(SR.SFxTimeoutOutOfRange0))); } if (TimeoutHelper.IsTooLarge(value)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value", value, SR.GetString(SR.SFxTimeoutOutOfRangeTooBig))); } this.transactionTimeout = value; } } public CallbackTimeoutsBehavior() { } void IEndpointBehavior.Validate(ServiceEndpoint serviceEndpoint) { } void IEndpointBehavior.AddBindingParameters(ServiceEndpoint serviceEndpoint, BindingParameterCollection bindingParameters) { } void IEndpointBehavior.ApplyDispatchBehavior(ServiceEndpoint serviceEndpoint, EndpointDispatcher endpointDispatcher) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException( SR.GetString(SR.SFXEndpointBehaviorUsedOnWrongSide, typeof(CallbackTimeoutsBehavior).Name))); } void IEndpointBehavior.ApplyClientBehavior(ServiceEndpoint serviceEndpoint, ClientRuntime behavior) { if(this.transactionTimeout != TimeSpan.Zero) { ChannelDispatcher channelDispatcher = behavior.CallbackDispatchRuntime.ChannelDispatcher; if ((channelDispatcher != null) && (channelDispatcher.TransactionTimeout == TimeSpan.Zero) || (channelDispatcher.TransactionTimeout > this.transactionTimeout)) { channelDispatcher.TransactionTimeout = this.transactionTimeout; } } } } } // 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
- DoubleAverageAggregationOperator.cs
- ApplicationContext.cs
- KeyConverter.cs
- PerfService.cs
- Image.cs
- WebPartDisplayModeCollection.cs
- TTSEngineProxy.cs
- EntityDataReader.cs
- SystemDiagnosticsSection.cs
- NavigatorOutput.cs
- MetabaseReader.cs
- GlyphCache.cs
- PolicyException.cs
- DesignerValidatorAdapter.cs
- CmsUtils.cs
- ipaddressinformationcollection.cs
- ActivityExecutionContext.cs
- Icon.cs
- TextElementAutomationPeer.cs
- AuthenticatingEventArgs.cs
- CalendarButton.cs
- PropertyDescriptor.cs
- RotateTransform3D.cs
- ServiceContractViewControl.cs
- LayoutUtils.cs
- XsltLoader.cs
- PartialClassGenerationTask.cs
- TextServicesContext.cs
- ToolStripItemImageRenderEventArgs.cs
- FontResourceCache.cs
- MultilineStringConverter.cs
- TextBlockAutomationPeer.cs
- FilterException.cs
- ActiveXContainer.cs
- Rijndael.cs
- shaperfactoryquerycachekey.cs
- MethodCallTranslator.cs
- DataGridPagingPage.cs
- VisualStyleRenderer.cs
- Point3DKeyFrameCollection.cs
- RegexCharClass.cs
- IImplicitResourceProvider.cs
- CodePageUtils.cs
- DaylightTime.cs
- NotFiniteNumberException.cs
- ConstructorExpr.cs
- PriorityRange.cs
- AsmxEndpointPickerExtension.cs
- CalloutQueueItem.cs
- Debug.cs
- followingsibling.cs
- OleServicesContext.cs
- WorkflowRuntimeServiceElement.cs
- UIElement.cs
- CheckBoxAutomationPeer.cs
- SortQuery.cs
- CacheVirtualItemsEvent.cs
- XmlExtensionFunction.cs
- CodeVariableReferenceExpression.cs
- KeyPressEvent.cs
- CryptoConfig.cs
- MainMenu.cs
- InstanceDataCollectionCollection.cs
- Models.cs
- CatalogPartDesigner.cs
- GridProviderWrapper.cs
- GeometryCombineModeValidation.cs
- FileLogRecordHeader.cs
- CertificateManager.cs
- DescendantOverDescendantQuery.cs
- LinearGradientBrush.cs
- CellTreeNodeVisitors.cs
- AlphaSortedEnumConverter.cs
- AsynchronousChannelMergeEnumerator.cs
- DisposableCollectionWrapper.cs
- SafeHGlobalHandleCritical.cs
- mda.cs
- GlyphRun.cs
- UrlMappingCollection.cs
- ToolStripItemImageRenderEventArgs.cs
- Pair.cs
- MapPathBasedVirtualPathProvider.cs
- HandlerFactoryWrapper.cs
- ApplicationCommands.cs
- MulticastDelegate.cs
- RawTextInputReport.cs
- TypeContext.cs
- XmlSerializationGeneratedCode.cs
- EditorZoneBase.cs
- HttpContextWrapper.cs
- BrowserDefinitionCollection.cs
- XPathNavigator.cs
- EventManager.cs
- XamlGridLengthSerializer.cs
- WebRequest.cs
- CapabilitiesAssignment.cs
- RuntimeHelpers.cs
- ValidationSummary.cs
- FlowLayoutPanel.cs
- RegexCharClass.cs