System.Diagnostics.PerformanceCounterLib.PerformanceMonitor.GetData C# (CSharp) Method

GetData() private method

private GetData ( string item ) : byte[]
item string
return byte[]
            internal byte[] GetData(string item)
            {
                int waitRetries = 17;   //2^16*10ms == approximately 10mins
                int waitSleep = 0;
                byte[] data = null;
                int error = 0;

                while (waitRetries > 0)
                {
                    try
                    {
                        data = (byte[])_perfDataKey.GetValue(item);
                        return data;
                    }
                    catch (IOException e)
                    {
                        error = e.HResult;
                        switch (error)
                        {
                            case Interop.Advapi32.RPCStatus.RPC_S_CALL_FAILED:
                            case Interop.Errors.ERROR_INVALID_HANDLE:
                            case Interop.Advapi32.RPCStatus.RPC_S_SERVER_UNAVAILABLE:
                                Init();
                                goto case Interop.Advapi32.WaitOptions.WAIT_TIMEOUT;

                            case Interop.Advapi32.WaitOptions.WAIT_TIMEOUT:
                            case Interop.Errors.ERROR_NOT_READY:
                            case Interop.Errors.ERROR_LOCK_FAILED:
                            case Interop.Errors.ERROR_BUSY:
                                --waitRetries;
                                if (waitSleep == 0)
                                {
                                    waitSleep = 10;
                                }
                                else
                                {
                                    System.Threading.Thread.Sleep(waitSleep);
                                    waitSleep *= 2;
                                }
                                break;

                            default:
                                throw new Win32Exception(error);
                        }
                    }
                    catch (InvalidCastException e)
                    {
                        throw new InvalidOperationException(SR.Format(SR.CounterDataCorrupt, _perfDataKey.ToString()), e);
                    }
                }

                throw new Win32Exception(error);
            }
        }
PerformanceCounterLib.PerformanceMonitor