有人知道如何设置发现超时。默认值类似于10-15s,它接缝有点长......
在女巫方面是否必须配置?服务?客户端?
服务:
// Add a ServiceDiscoveryBehavior
host.Description.Behaviors.Add(new ServiceDiscoveryBehavior());
// Add a UdpDiscoveryEndpoint
host.AddServiceEndpoint(new UdpDiscoveryEndpoint());
客户端:
EndpointAddress endPoint = null;
endPoint = FindCalculatorServiceAddress();
static EndpointAddress FindCalculatorServiceAddress()
{
// Create DiscoveryClient
DiscoveryClient discoveryClient = new DiscoveryClient(new UdpDiscoveryEndpoint());
// Find IStringReverser endpoints
FindResponse findResponse = discoveryClient.Find(new FindCriteria(typeof(IStringReverser)));
if (findResponse.Endpoints.Count > 0)
{
return findResponse.Endpoints[0].Address;
}
else
{
return null;
}
}
提前致谢