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
- SerializationStore.cs
- DbMetaDataColumnNames.cs
- Missing.cs
- TextEditorTables.cs
- NumericExpr.cs
- DBCommandBuilder.cs
- XPathScanner.cs
- HiddenField.cs
- COAUTHINFO.cs
- SimpleColumnProvider.cs
- WebPartDescriptionCollection.cs
- EntityContainer.cs
- _ProxyRegBlob.cs
- ScaleTransform.cs
- DeferredTextReference.cs
- ColorEditor.cs
- NonVisualControlAttribute.cs
- SystemResourceHost.cs
- DbMetaDataFactory.cs
- TextCompositionManager.cs
- precedingquery.cs
- ScrollViewer.cs
- ModifierKeysValueSerializer.cs
- ExceptionHandlersDesigner.cs
- CursorConverter.cs
- PropertyMetadata.cs
- SqlWebEventProvider.cs
- ConfigurationValidatorBase.cs
- DispatcherTimer.cs
- FontStyle.cs
- ObjectViewQueryResultData.cs
- TextParagraphCache.cs
- PropertySegmentSerializationProvider.cs
- _SslState.cs
- DesignSurfaceEvent.cs
- WindowPatternIdentifiers.cs
- SafeFindHandle.cs
- ConfigurationValues.cs
- SmuggledIUnknown.cs
- SQLMoneyStorage.cs
- Relationship.cs
- RequestQueryProcessor.cs
- SecurityAttributeGenerationHelper.cs
- ToolBarOverflowPanel.cs
- OutputWindow.cs
- ControlCollection.cs
- XmlWriterTraceListener.cs
- SmtpMail.cs
- SHA256.cs
- DeclaredTypeValidator.cs
- EventWaitHandle.cs
- ReferentialConstraint.cs
- TextEffectResolver.cs
- RecognizerStateChangedEventArgs.cs
- Path.cs
- ApplicationDirectory.cs
- Preprocessor.cs
- WindowsListViewItem.cs
- SubMenuStyleCollection.cs
- InkCanvasAutomationPeer.cs
- InstanceView.cs
- BlockUIContainer.cs
- SymmetricAlgorithm.cs
- ConfigurationStrings.cs
- NativeMethods.cs
- XmlSchemaDatatype.cs
- OutputCacheSection.cs
- PropertiesTab.cs
- ConstraintManager.cs
- XmlCharacterData.cs
- EntityContainer.cs
- NaturalLanguageHyphenator.cs
- BatchStream.cs
- CodeTypeDeclaration.cs
- UTF8Encoding.cs
- CodeIterationStatement.cs
- BitmapEffectGroup.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- ObjectQuery_EntitySqlExtensions.cs
- Visual.cs
- GPRECTF.cs
- ProfileEventArgs.cs
- ChannelFactoryRefCache.cs
- GridViewColumn.cs
- ExpressionParser.cs
- Char.cs
- EntityDataSourceUtil.cs
- XmlMessageFormatter.cs
- SecurityVerifiedMessage.cs
- AutomationAttributeInfo.cs
- FolderLevelBuildProviderCollection.cs
- XmlExceptionHelper.cs
- RadioButton.cs
- hwndwrapper.cs
- StatusBar.cs
- StreamSecurityUpgradeInitiatorAsyncResult.cs
- ZipIORawDataFileBlock.cs
- JsonEnumDataContract.cs
- DebugView.cs
- HttpProfileGroupBase.cs