【发布时间】:2014-02-15 04:03:54
【问题描述】:
是否可以通过 Wcftest 客户端测试 WCF 节流行为?
如果是,那么如何?
我在下面有一个 ServiceHost 的代码
ServiceThrottlingBehavior stb = _servicehost.Description.Behaviors.Find<ServiceThrottlingBehavior>();
if (stb == null)
{
stb = new ServiceThrottlingBehavior();
stb.MaxConcurrentCalls = 1;
stb.MaxConcurrentInstances = 1;
stb.MaxConcurrentSessions = 1;
_servicehost.Description.Behaviors.Add(stb);
}
我的服务有一个方法如:
public string ThrottlingCheck()
{
Thread.Sleep(new TimeSpan(0, 0, 0, 5, 0));//5 seconds
return "Invoke Complete";
}
【问题讨论】:
标签: c# .net wcf throttling