예제 #1
0
        private void CopyStream(CobaltFile file, Stream stream)
        {
            var tries = 3;

            for (int i = 0; i < tries; i++)
            {
                try
                {
                    GenericFdaStream myCobaltStream = new GenericFda(file.CobaltEndpoint, null).GetContentStream();

                    myCobaltStream.CopyTo(stream);

                    break;
                }
                catch (Exception)
                {
                    //unable to read update - save failed
                    if (i == tries - 1)
                    {
                        throw;
                    }

                    //waiting for cobalt completion
                    Thread.Sleep(50);
                }
            }
        }
예제 #2
0
        private void CopyStream(CobaltFile file, Stream stream)
        {
            var tries = 3;

            for (int i = 0; i < tries; i++)
            {
                try
                {
                    GenericFdaStream myCobaltStream = new GenericFda(file.CobaltEndpoint, null).GetContentStream();

                    myCobaltStream.CopyTo(stream);

                    break;
                }
                catch (Exception)
                {
                    //unable to read update - save failed
                    if (i == tries - 1)
                    {
                        throw;
                    }

                    //waiting for cobalt completion
                    Thread.Sleep(50);
                }
            }
        }