[英]WCF and service discovery timeout
Does someone know how to set the timeout for discovery.有人知道如何设置发现超时。 The default value is like 10-15s and it seams a bit long...
默认值是 10-15 秒,接缝有点长......
On witch side does it have to be configured?在女巫方面是否必须配置? Service?
服务? Client?
客户?
Service:服务:
// Add a ServiceDiscoveryBehavior
host.Description.Behaviors.Add(new ServiceDiscoveryBehavior());
// Add a UdpDiscoveryEndpoint
host.AddServiceEndpoint(new UdpDiscoveryEndpoint());
Client:客户:
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;
}
}
Thanks in advance提前致谢
I believe you need to set the Duration property of FindCriteria我相信你需要设置 FindCriteria 的 Duration 属性
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.