// Token: 0x06002249 RID: 8777 RVA: 0x0009FDB0 File Offset: 0x0009DFB0
        public override long QueryEndOfLog()
        {
            long num = -1L;

            this.GetChannelLock();
            try
            {
                this.OpenChannelIfFirstRequest();
                NotifyEndOfLogRequest msg = new NotifyEndOfLogRequest(this.m_channel, this.DatabaseGuid, 0L);
                this.SendMessage(msg);
                NetworkChannelMessage reply = this.GetReply();
                NotifyEndOfLogReply   notifyEndOfLogReply = reply as NotifyEndOfLogReply;
                if (notifyEndOfLogReply == null)
                {
                    this.m_channel.ThrowUnexpectedMessage(reply);
                }
                this.m_endOfLog.SetValue(notifyEndOfLogReply.EndOfLogGeneration, new DateTime?(notifyEndOfLogReply.EndOfLogUtc));
                num = notifyEndOfLogReply.EndOfLogGeneration;
            }
            finally
            {
                this.ReleaseChannelLock();
            }
            ExTraceGlobals.LogCopyClientTracer.TraceDebug <long>((long)this.GetHashCode(), "LogCopyClient:QueryEndOfLog: 0x{0:x}", num);
            return(num);
        }
Example #2
0
        // Token: 0x06001AC5 RID: 6853 RVA: 0x00072DCC File Offset: 0x00070FCC
        public void SendLogFiles()
        {
            MonitoredDatabase monitoredDatabase = this.GetMonitoredDatabase();
            string            suffix            = '.' + monitoredDatabase.Config.LogExtension;
            DirectoryInfo     di = new DirectoryInfo(monitoredDatabase.Config.SourceLogPath);
            long num             = ShipControl.HighestGenerationInDirectory(di, monitoredDatabase.Config.LogFilePrefix, suffix);
            long num2            = ShipControl.LowestGenerationInDirectory(di, monitoredDatabase.Config.LogFilePrefix, suffix, false);

            for (long num3 = num2; num3 <= num; num3 += 1L)
            {
                this.CheckSeedingCancelled();
                try
                {
                    monitoredDatabase.SendLog(num3, this.m_channel, null);
                }
                catch (FileIOonSourceException ex)
                {
                    ExTraceGlobals.SeederServerTracer.TraceDebug <long, Exception>((long)this.GetHashCode(), "failed to send generation 0x{0:X} because {1}", num3, ex.InnerException);
                    this.m_channel.SendException(ex.InnerException);
                    this.CancelSeeding(ex.LocalizedString);
                    return;
                }
            }
            NotifyEndOfLogReply notifyEndOfLogReply = new NotifyEndOfLogReply(this.m_channel, NetworkChannelMessage.MessageType.NotifyEndOfLogReply, num, DateTime.UtcNow);

            this.TraceDebug("reached the end of log files", new object[0]);
            notifyEndOfLogReply.Send();
        }
        public override void Execute()
        {
            MonitoredDatabase   monitoredDatabase   = base.Channel.MonitoredDatabase;
            EndOfLog            currentEndOfLog     = monitoredDatabase.CurrentEndOfLog;
            NotifyEndOfLogReply notifyEndOfLogReply = new NotifyEndOfLogReply(base.Channel, NetworkChannelMessage.MessageType.NotifyEndOfLogReply, currentEndOfLog.Generation, currentEndOfLog.Utc);

            notifyEndOfLogReply.Send();
        }