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
- SoapAttributeAttribute.cs
- TypefaceCollection.cs
- ErrorProvider.cs
- StaticTextPointer.cs
- BufferModesCollection.cs
- DescendantQuery.cs
- TextParagraph.cs
- UserPreferenceChangingEventArgs.cs
- RotateTransform.cs
- ExitEventArgs.cs
- DataGridSortCommandEventArgs.cs
- PropertyCollection.cs
- TreeNodeCollectionEditor.cs
- ApplicationInterop.cs
- PersistenceTypeAttribute.cs
- PatternMatchRules.cs
- AsymmetricAlgorithm.cs
- GACMembershipCondition.cs
- CalendarModeChangedEventArgs.cs
- CollectionViewGroupRoot.cs
- SqlConnectionStringBuilder.cs
- NumberFormatter.cs
- DockingAttribute.cs
- MarkupExtensionParser.cs
- ToolboxDataAttribute.cs
- UnsafeNativeMethods.cs
- XmlILStorageConverter.cs
- PtsHelper.cs
- GeometryCollection.cs
- BaseValidatorDesigner.cs
- FormsAuthenticationUser.cs
- UpdateManifestForBrowserApplication.cs
- BitmapEffectCollection.cs
- BehaviorEditorPart.cs
- WebPartConnectionsEventArgs.cs
- ZoomPercentageConverter.cs
- TreeNodeStyleCollection.cs
- WebBrowser.cs
- PtsContext.cs
- BitmapEffectInputConnector.cs
- Point4DConverter.cs
- ThreadInterruptedException.cs
- RightsManagementEncryptionTransform.cs
- GridViewCellAutomationPeer.cs
- ToolboxBitmapAttribute.cs
- UpdateExpressionVisitor.cs
- DataGridrowEditEndingEventArgs.cs
- BufferedGraphics.cs
- VirtualPathUtility.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- Utils.cs
- XmlArrayAttribute.cs
- RankException.cs
- WindowsSspiNegotiation.cs
- GridViewCommandEventArgs.cs
- TreeNodeCollection.cs
- BufferedOutputStream.cs
- PolyBezierSegment.cs
- OpCodes.cs
- WaitingCursor.cs
- ProxyWebPartManager.cs
- JsonGlobals.cs
- InitializationEventAttribute.cs
- CodeConditionStatement.cs
- SynchronizationScope.cs
- Figure.cs
- AxHost.cs
- SwitchCase.cs
- EventLogPermissionEntryCollection.cs
- RtfControlWordInfo.cs
- ProfileModule.cs
- SignedXml.cs
- MessageHeaderT.cs
- RowBinding.cs
- CleanUpVirtualizedItemEventArgs.cs
- ConnectionConsumerAttribute.cs
- SqlRowUpdatingEvent.cs
- SafeArrayTypeMismatchException.cs
- ObjectComplexPropertyMapping.cs
- ProtocolsSection.cs
- sqlpipe.cs
- PtsHelper.cs
- OleDbEnumerator.cs
- InputLanguageProfileNotifySink.cs
- _NtlmClient.cs
- PlaceHolder.cs
- DesignerLabelAdapter.cs
- ProtocolsConfigurationEntry.cs
- Serializer.cs
- SymLanguageVendor.cs
- DataSourceControlBuilder.cs
- MarkupCompilePass1.cs
- XmlSchemaSimpleTypeUnion.cs
- ExceptionHelpers.cs
- GlyphsSerializer.cs
- Matrix3D.cs
- DataGridViewCellStyleChangedEventArgs.cs
- MasterPageParser.cs
- BeginEvent.cs
- safemediahandle.cs