description | title | ms.date | ms.assetid |
---|---|---|---|
Learn more about: How to:Determine the Discovery Version of a Probe Request |
How to:Determine the Discovery Version of a Probe Request |
03/30/2017 |
b3c4e2e2-2957-4074-ae6a-776a5ca84278 |
A discovery proxy may expose multiple discovery endpoints using different discovery versions. When a UDP multicast Probe request arrives at the proxy, the proxy should respond with a multicast suppression message. In order to do this, it would have to know the discovery version of the request.
In the method that responds to a Probe request (for example xref:System.ServiceModel.Discovery.DiscoveryProxy.OnBeginFind%2A?displayProperty=nameWithType) use the static xref:System.ServiceModel.OperationContext.Current%2A?displayProperty=nameWithType property to search for a xref:System.ServiceModel.Discovery.DiscoveryOperationContextExtension, as shown in the following code.
DiscoveryOperationContextExtension doce = OperationContext.Current.Extensions.Find<DiscoveryOperationContextExtension>();
// Access the discovery version from the DiscoveryOperationContextExtension
doce.DiscoveryVersion;
- xref:System.ServiceModel.Discovery.Configuration.AnnouncementEndpointElement.DiscoveryVersion%2A
- Implementing a Discovery Proxy