Does anyone know how to set a timeout for detection. The default value is similar to 10-15 seconds and it is a bit longer ...
On the other hand, do I need to configure it? Service? Customer?
Services:
host.Description.Behaviors.Add(new ServiceDiscoveryBehavior());
host.AddServiceEndpoint(new UdpDiscoveryEndpoint());
Customer:
EndpointAddress endPoint = null;
endPoint = FindCalculatorServiceAddress();
static EndpointAddress FindCalculatorServiceAddress()
{
DiscoveryClient discoveryClient = new DiscoveryClient(new UdpDiscoveryEndpoint());
FindResponse findResponse = discoveryClient.Find(new FindCriteria(typeof(IStringReverser)));
if (findResponse.Endpoints.Count > 0)
{
return findResponse.Endpoints[0].Address;
}
else
{
return null;
}
}
Thanks in advance
John source
share