Exemple #1
0
        public void SetBandwidthThrottleAndGetThrottleState()
        {
            this.MixPlayWrapper(async(MixerConnection connection, MixPlayClient client) =>
            {
                this.ClearPackets();

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

                bool result = await client.SetBandwidthThrottleWithResponse(bandwidthThrottle);

                Assert.IsTrue(result);

                this.ClearPackets();

                MixPlayGetThrottleStateModel throttleState = await client.GetThrottleState();

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