コード例 #1
0
        private async Task StartupClient(ControlClient client)
        {
            await Task.Yield();

            await client.Connect();

            var token = new CancellationTokenSource(TimeSpan.FromMinutes(1));

            while (true)
            {
                if (token.IsCancellationRequested)
                {
                    throw new Exception("Could not lock tuner.");
                }

                try
                {
                    await client.Lock();

                    break;
                }
                catch
                {
                    // This space intentionally left blank.
                }
            }
        }