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
- MultiSelector.cs
- AdornerPresentationContext.cs
- TargetConverter.cs
- Context.cs
- TypeInfo.cs
- DriveInfo.cs
- DataGridCaption.cs
- DetailsViewUpdatedEventArgs.cs
- IPEndPointCollection.cs
- AnimatedTypeHelpers.cs
- CodeAttributeArgumentCollection.cs
- XmlSerializationWriter.cs
- BevelBitmapEffect.cs
- ComponentEditorForm.cs
- StyleSelector.cs
- Brush.cs
- DoubleLinkListEnumerator.cs
- ListViewItemSelectionChangedEvent.cs
- EdmFunctionAttribute.cs
- FormViewInsertedEventArgs.cs
- RepeatButtonAutomationPeer.cs
- DetailsViewDeleteEventArgs.cs
- BStrWrapper.cs
- ProfilePropertySettings.cs
- SelectorAutomationPeer.cs
- TemplatePagerField.cs
- HierarchicalDataSourceControl.cs
- TransformerConfigurationWizardBase.cs
- IISUnsafeMethods.cs
- ListViewPagedDataSource.cs
- ResizeGrip.cs
- GorillaCodec.cs
- GridViewAutoFormat.cs
- oledbconnectionstring.cs
- SchemaCollectionPreprocessor.cs
- NetworkInformationException.cs
- HScrollBar.cs
- EntitySetRetriever.cs
- COM2EnumConverter.cs
- ClientBuildManager.cs
- SslStream.cs
- diagnosticsswitches.cs
- ComponentEditorPage.cs
- HandlerBase.cs
- Point3DCollectionConverter.cs
- ConnectionStringsSection.cs
- NetworkInformationException.cs
- EntityDataSourceMemberPath.cs
- XmlSerializerFactory.cs
- ColorAnimationBase.cs
- TypedDataSourceCodeGenerator.cs
- DataListItemEventArgs.cs
- PropertyPathConverter.cs
- FixedSOMTextRun.cs
- XhtmlBasicValidationSummaryAdapter.cs
- MessagingActivityHelper.cs
- ColumnReorderedEventArgs.cs
- XmlUnspecifiedAttribute.cs
- ImageMap.cs
- DBSchemaRow.cs
- PrintingPermission.cs
- GroupBoxRenderer.cs
- XmlSchemaAnnotated.cs
- WriteableOnDemandStream.cs
- QueryContinueDragEvent.cs
- TransactionManager.cs
- CodeGenerator.cs
- GraphicsContainer.cs
- PropertyItemInternal.cs
- GraphicsPathIterator.cs
- ManipulationDevice.cs
- LoginView.cs
- objectquery_tresulttype.cs
- CommandHelpers.cs
- DataStorage.cs
- IfJoinedCondition.cs
- WorkflowServiceInstance.cs
- ClientTargetCollection.cs
- AppSettingsSection.cs
- AdRotator.cs
- ListenerConnectionModeReader.cs
- DBCommand.cs
- FileCodeGroup.cs
- ListViewInsertEventArgs.cs
- NotifyIcon.cs
- DataGridCaption.cs
- FileDialogCustomPlace.cs
- DesignerAdapterAttribute.cs
- OptimalBreakSession.cs
- ScriptManager.cs
- InitializationEventAttribute.cs
- IListConverters.cs
- TraceFilter.cs
- ReadOnlyCollectionBase.cs
- StickyNoteHelper.cs
- ImageMap.cs
- Cursor.cs
- ServerValidateEventArgs.cs
- CompositeFontParser.cs
- Size3D.cs