Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.ServiceModel.Discovery / System / ServiceModel / Discovery / UdpContractFilterBehavior.cs / 1305376 / UdpContractFilterBehavior.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.ServiceModel.Discovery { using System.Runtime; using System.ServiceModel.Description; using System.ServiceModel.Dispatcher; using System.ServiceModel.Channels; // This behavior sets the contract filter and unhandled operation invoker in the dispatch // runtime to avoid contract filter mismatch exceptions raised by runtime during normal operation. // Since the different discovery messages from different versions are sent over the same multicast // address and port, it is normal for an endpoint to receive the messages that are not matching // its contract. This behavior is only added to UdpDiscoveryEndpoint and UdpAnnouncementEndpoint. class UdpContractFilterBehavior : IEndpointBehavior { public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters) { } public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime) { } public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher) { if (endpointDispatcher == null) { throw FxTrace.Exception.ArgumentNull("endpointDispatcher"); } endpointDispatcher.ContractFilter = new MatchAllMessageFilter(); endpointDispatcher.DispatchRuntime.UnhandledDispatchOperation.Invoker = new UnhandledActionOperationInvoker(); } public void Validate(ServiceEndpoint endpoint) { } class UnhandledActionOperationInvoker : IOperationInvoker { public bool IsSynchronous { get { return true; } } public object[] AllocateInputs() { return EmptyArray.Allocate(1); } public object Invoke(object instance, object[] inputs, out object[] outputs) { outputs = EmptyArray.Allocate(0); return null; } public IAsyncResult InvokeBegin(object instance, object[] inputs, AsyncCallback callback, object state) { throw FxTrace.Exception.AsError(new NotImplementedException()); } public object InvokeEnd(object instance, out object[] outputs, IAsyncResult result) { throw FxTrace.Exception.AsError(new NotImplementedException()); } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WindowsScrollBarBits.cs
- ListViewSortEventArgs.cs
- UserControlBuildProvider.cs
- PackageStore.cs
- ProcessThreadCollection.cs
- XmlTextWriter.cs
- XsltException.cs
- XPathNodeList.cs
- DateTimeValueSerializerContext.cs
- ServiceModelDictionary.cs
- SecurityUtils.cs
- XmlArrayItemAttribute.cs
- Ipv6Element.cs
- WebPartZoneAutoFormat.cs
- TimelineClockCollection.cs
- DataGridViewUtilities.cs
- ArglessEventHandlerProxy.cs
- ValidationSummary.cs
- DateTimeValueSerializerContext.cs
- XmlCDATASection.cs
- DecoderFallback.cs
- NumericUpDownAcceleration.cs
- RequestResponse.cs
- TerminatorSinks.cs
- DataColumnMapping.cs
- XmlEntity.cs
- AssertFilter.cs
- EvidenceTypeDescriptor.cs
- FixUp.cs
- SoapMessage.cs
- AnnotationHelper.cs
- EventProxy.cs
- documentsequencetextpointer.cs
- SystemShuttingDownException.cs
- AnnotationAdorner.cs
- JsonGlobals.cs
- xmlsaver.cs
- RightsManagementResourceHelper.cs
- DataView.cs
- XPathMessageFilterElementCollection.cs
- Opcode.cs
- CodePageUtils.cs
- BitmapEffectGeneralTransform.cs
- BooleanAnimationUsingKeyFrames.cs
- StyleTypedPropertyAttribute.cs
- EntityStoreSchemaGenerator.cs
- GenericNameHandler.cs
- ConfigurationStrings.cs
- XsltException.cs
- EntityDataSourceWrapperCollection.cs
- EntityTypeEmitter.cs
- FrameworkElementFactoryMarkupObject.cs
- TextTreeTextNode.cs
- SchemaCollectionPreprocessor.cs
- ToolStripPanelRenderEventArgs.cs
- ColorInterpolationModeValidation.cs
- CodeVariableDeclarationStatement.cs
- TypeElement.cs
- ACE.cs
- JapaneseCalendar.cs
- WebPartDisplayModeCancelEventArgs.cs
- ComponentRenameEvent.cs
- KeyFrames.cs
- ValidationPropertyAttribute.cs
- SystemTcpConnection.cs
- MimeTypeMapper.cs
- EntityDataSourceView.cs
- AutoSizeComboBox.cs
- FunctionUpdateCommand.cs
- KeyTimeConverter.cs
- ListenerConstants.cs
- OleStrCAMarshaler.cs
- SystemIPGlobalProperties.cs
- InstalledVoice.cs
- PagedDataSource.cs
- IntellisenseTextBox.cs
- FontWeightConverter.cs
- TypedReference.cs
- StatusBarItemAutomationPeer.cs
- PropertyChangedEventManager.cs
- LogicalExpr.cs
- TimeSpan.cs
- CompleteWizardStep.cs
- WebPartConnectionsCancelEventArgs.cs
- RadioButton.cs
- HtmlMeta.cs
- DockProviderWrapper.cs
- MeshGeometry3D.cs
- EntityDesignPluralizationHandler.cs
- LogWriteRestartAreaAsyncResult.cs
- PowerStatus.cs
- BulletedList.cs
- IISUnsafeMethods.cs
- StylusDownEventArgs.cs
- UnsafeNativeMethods.cs
- IgnoreFileBuildProvider.cs
- ParameterModifier.cs
- CodeSnippetTypeMember.cs
- IndexerNameAttribute.cs
- StateManagedCollection.cs