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
- TabItemWrapperAutomationPeer.cs
- PointConverter.cs
- baseaxisquery.cs
- ImpersonateTokenRef.cs
- SwitchElementsCollection.cs
- OracleConnectionStringBuilder.cs
- UnSafeCharBuffer.cs
- BindingExpressionBase.cs
- TriggerAction.cs
- BrowserCapabilitiesFactory.cs
- XmlReader.cs
- BackEase.cs
- MatrixAnimationUsingKeyFrames.cs
- XmlSchemaGroup.cs
- SqlCrossApplyToCrossJoin.cs
- DesignerActionHeaderItem.cs
- CompiledIdentityConstraint.cs
- PropertyIDSet.cs
- HttpFileCollection.cs
- SparseMemoryStream.cs
- RemotingSurrogateSelector.cs
- CollectionViewGroup.cs
- RegistrationServices.cs
- WindowsEditBox.cs
- NestedContainer.cs
- ExceptionHandlerDesigner.cs
- CompiledIdentityConstraint.cs
- IPEndPoint.cs
- sortedlist.cs
- DispatcherTimer.cs
- SpeechDetectedEventArgs.cs
- VisualCollection.cs
- GridViewDeleteEventArgs.cs
- ConstructorNeedsTagAttribute.cs
- WindowsImpersonationContext.cs
- ExpressionBuilderCollection.cs
- ToolboxDataAttribute.cs
- Timer.cs
- ContentFileHelper.cs
- SiteMapPath.cs
- VisualBasicSettingsHandler.cs
- AmbientLight.cs
- GridItemCollection.cs
- ProtocolsConfiguration.cs
- KeyGestureValueSerializer.cs
- RoleGroupCollection.cs
- ProxyManager.cs
- Group.cs
- VirtualPath.cs
- TdsParserStateObject.cs
- ListViewAutomationPeer.cs
- RegexCompilationInfo.cs
- ResponseBodyWriter.cs
- AssemblySettingAttributes.cs
- ParameterToken.cs
- Border.cs
- ItemCheckedEvent.cs
- TargetParameterCountException.cs
- HtmlHistory.cs
- LineServicesRun.cs
- PriorityQueue.cs
- MeasurementDCInfo.cs
- FormsIdentity.cs
- PropertyIdentifier.cs
- GregorianCalendar.cs
- Int32Rect.cs
- SoapEnumAttribute.cs
- TreeNodeSelectionProcessor.cs
- ObjectSelectorEditor.cs
- SqlTriggerAttribute.cs
- ProtectedConfigurationProviderCollection.cs
- MissingMemberException.cs
- ErrorLog.cs
- EncryptedData.cs
- DataGridViewSelectedRowCollection.cs
- FileRegion.cs
- InstalledFontCollection.cs
- LinqDataSourceInsertEventArgs.cs
- XmlNodeChangedEventArgs.cs
- ItemCollection.cs
- DiscoveryEndpointValidator.cs
- EditorPart.cs
- TdsValueSetter.cs
- ISessionStateStore.cs
- ObjectQueryProvider.cs
- PathSegmentCollection.cs
- DXD.cs
- ImpersonateTokenRef.cs
- Array.cs
- SHA1CryptoServiceProvider.cs
- OpenTypeLayout.cs
- FunctionParameter.cs
- GenericRootAutomationPeer.cs
- LineBreak.cs
- DataContractSerializer.cs
- UserPersonalizationStateInfo.cs
- FixedSOMContainer.cs
- OleDbParameter.cs
- FunctionCommandText.cs
- StorageConditionPropertyMapping.cs