public void SetBandwidthThrottleAndGetThrottleState()
        {
            this.InteractiveWrapper(async(MixerConnection connection, InteractiveClient interactiveClient) =>
            {
                this.ClearPackets();

                InteractiveSetBandwidthThrottleModel bandwidthThrottle = new InteractiveSetBandwidthThrottleModel();
                bandwidthThrottle.AddThrottle("giveInput", 10000000, 3000000);

                bool result = await interactiveClient.SetBandwidthThrottleWithResponse(bandwidthThrottle);

                Assert.IsTrue(result);

                this.ClearPackets();

                InteractiveGetThrottleStateModel throttleState = await interactiveClient.GetThrottleState();

                Assert.IsNotNull(throttleState);
                Assert.IsTrue(throttleState.MethodThrottles.Count > 0);
            });
        }
Esempio n. 2
0
 private MethodPacket BuildBandwidthThrottlePacket(InteractiveSetBandwidthThrottleModel throttling)
 {
     Validator.ValidateVariable(throttling, "throttling");
     return(new MethodParamsPacket("setBandwidthThrottle", throttling));
 }
Esempio n. 3
0
 /// <summary>
 /// Sets the memory throttling for the specified interactive APIs
 /// </summary>
 /// <param name="throttling">The throttling to set</param>
 /// <returns>Whether the operation succeeded</returns>
 public async Task <bool> SetBandwidthThrottleWithResponse(InteractiveSetBandwidthThrottleModel throttling)
 {
     return(this.VerifyNoErrors(await this.SendAndListen(this.BuildBandwidthThrottlePacket(throttling))));
 }
Esempio n. 4
0
 /// <summary>
 /// Sets the memory throttling for the specified interactive APIs
 /// </summary>
 /// <param name="throttling">The throttling to set</param>
 /// <returns>The task object representing the asynchronous operation</returns>
 public async Task SetBandwidthThrottle(InteractiveSetBandwidthThrottleModel throttling)
 {
     await this.Send(this.BuildBandwidthThrottlePacket(throttling));
 }