예제 #1
0
 ///<summary>
 ///  Can only call before openning the host
 ///</summary>
 public static void SetThrottle(this ServiceHost host,int maxCalls,int maxSessions,int maxInstances)
 {
    ServiceThrottlingBehavior throttle = new ServiceThrottlingBehavior();
    throttle.MaxConcurrentCalls = maxCalls;
    throttle.MaxConcurrentSessions = maxSessions;
    throttle.MaxConcurrentInstances = maxInstances;
    host.SetThrottle(throttle);
 }
예제 #2
0
 /// <summary>
 /// Can only call before openning the host. Does not override config values if present
 /// </summary>
 public static void SetThrottle(this ServiceHost host, ServiceThrottlingBehavior serviceThrottle)
 {
     host.SetThrottle(serviceThrottle, false);
 }