// Token: 0x06002248 RID: 8776 RVA: 0x0009FC80 File Offset: 0x0009DE80
        internal static void QueryLogRange(Guid dbGuid, NetworkChannel ch, out long minGen, out long maxGen, out DateTime maxGenUtc)
        {
            minGen    = 0L;
            maxGen    = 0L;
            maxGenUtc = DateTime.UtcNow;
            bool       flag             = false;
            int        timeoutToRestore = 0;
            TcpChannel tcpChannel       = null;

            try
            {
                tcpChannel = ch.TcpChannel;
                if (tcpChannel.ReadTimeoutInMs < RegistryParameters.QueryLogRangeTimeoutInMsec)
                {
                    timeoutToRestore           = tcpChannel.ReadTimeoutInMs;
                    tcpChannel.ReadTimeoutInMs = RegistryParameters.QueryLogRangeTimeoutInMsec;
                }
                QueryLogRangeRequest queryLogRangeRequest = new QueryLogRangeRequest(ch, dbGuid);
                queryLogRangeRequest.Send();
                NetworkChannelMessage message            = ch.GetMessage();
                QueryLogRangeReply    queryLogRangeReply = message as QueryLogRangeReply;
                if (queryLogRangeReply == null)
                {
                    ch.ThrowUnexpectedMessage(message);
                }
                minGen    = queryLogRangeReply.FirstAvailableGeneration;
                maxGen    = queryLogRangeReply.EndOfLogGeneration;
                maxGenUtc = queryLogRangeReply.EndOfLogUtc;
                ExTraceGlobals.LogCopyClientTracer.TraceDebug <long, long>((long)ch.GetHashCode(), "LogCopyClient:TryQueryLogRange: 0x{0:x} .. {1:x}", minGen, maxGen);
                flag = true;
            }
            finally
            {
                if (timeoutToRestore > 0)
                {
                    if (!flag)
                    {
                        NetworkChannel.RunNetworkFunction(delegate
                        {
                            tcpChannel.ReadTimeoutInMs = timeoutToRestore;
                        });
                    }
                    else
                    {
                        tcpChannel.ReadTimeoutInMs = timeoutToRestore;
                    }
                }
            }
        }
        // Token: 0x06002247 RID: 8775 RVA: 0x0009FB60 File Offset: 0x0009DD60
        public override long QueryLogRange()
        {
            long       num        = 0L;
            bool       flag       = false;
            int        num2       = 0;
            TcpChannel tcpChannel = null;

            this.GetChannelLock();
            try
            {
                this.OpenChannelIfFirstRequest();
                tcpChannel = this.m_channel.TcpChannel;
                if (tcpChannel.ReadTimeoutInMs < RegistryParameters.QueryLogRangeTimeoutInMsec)
                {
                    num2 = tcpChannel.ReadTimeoutInMs;
                    tcpChannel.ReadTimeoutInMs = RegistryParameters.QueryLogRangeTimeoutInMsec;
                }
                QueryLogRangeRequest msg = new QueryLogRangeRequest(this.m_channel, this.DatabaseGuid);
                this.SendMessage(msg);
                NetworkChannelMessage reply = this.GetReply();
                QueryLogRangeReply    queryLogRangeReply = reply as QueryLogRangeReply;
                if (queryLogRangeReply == null)
                {
                    this.m_channel.ThrowUnexpectedMessage(reply);
                }
                this.m_endOfLog.SetValue(queryLogRangeReply.EndOfLogGeneration, new DateTime?(queryLogRangeReply.EndOfLogUtc));
                num = queryLogRangeReply.FirstAvailableGeneration;
                ExTraceGlobals.LogCopyClientTracer.TraceDebug <long, long>((long)this.GetHashCode(), "LogCopyClient:QueryLogRange: 0x{0:x} .. {1:x}", num, this.m_endOfLog.Generation);
                flag = true;
            }
            finally
            {
                if (!flag)
                {
                    this.DiscardChannel();
                }
                else if (num2 > 0)
                {
                    tcpChannel.ReadTimeoutInMs = num2;
                }
                this.ReleaseChannelLock();
            }
            return(num);
        }