How to:Determine the Discovery Version of a Probe Request

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.

To Determine the Discovery Version of a Probe Request

  1. In the method that responds to a Probe request (for example OnBeginFind) use the static Current property to search for a DiscoveryOperationContextExtension as shown in the following code.

    DiscoveryOperationContextExtension doce = OperationContext.Current.Extensions.Find<DiscoveryOperationContextExtension>();  
    // Access the discovery version from the DiscoveryOperationContextExtension  
    doce.DiscoveryVersion;  
    

See Also

DiscoveryVersion
Implementing a Discovery Proxy
Discovery Proxy Sample