예제 #1
0
 public void RemoveActiveLogCopyClient(LogCopyServerContext channel)
 {
     lock (this.m_activeLogCopyClients)
     {
         this.m_activeLogCopyClients.Remove(channel);
     }
 }
        internal static void StartContinuousLogTransmission(NetworkChannel channel, ContinuousLogCopyRequest oldReq)
        {
            LogCopyServerContext logCopyServerContext = new LogCopyServerContext(channel, channel.MonitoredDatabase);

            logCopyServerContext.m_clientIsDownLevel = true;
            LogCopyServerContext.Tracer.TraceDebug <string, bool>((long)logCopyServerContext.GetHashCode(), "Passive({0}) is downlevel {1}}", channel.PartnerNodeName, logCopyServerContext.m_clientIsDownLevel);
            ContinuousLogCopyRequest2 initialRequest = LogCopyServerContext.UpgradeRequest(channel, oldReq);

            logCopyServerContext.InitContinuousLogTransmission(initialRequest);
        }
예제 #3
0
        public bool AddActiveLogCopyClient(LogCopyServerContext channel)
        {
            bool result = false;

            lock (this.m_activeLogCopyClients)
            {
                if (!this.m_stopped)
                {
                    this.m_activeLogCopyClients.Add(channel);
                    result = true;
                }
            }
            return(result);
        }
 private void HandleIncomingMessage()
 {
     try
     {
         if (!this.m_markedForTermination)
         {
             lock (this.m_networkReadLock)
             {
                 NetworkChannelMessage message     = this.Channel.GetMessage();
                 PingMessage           pingMessage = message as PingMessage;
                 if (pingMessage != null)
                 {
                     LogCopyServerContext.Tracer.TraceDebug((long)this.GetHashCode(), "HandleIncomingMessage: Ping received");
                     Interlocked.Exchange(ref this.m_pingPending, 1);
                     this.m_sendDataEnabled = true;
                 }
                 else
                 {
                     ContinuousLogCopyRequest2 continuousLogCopyRequest = message as ContinuousLogCopyRequest2;
                     if (continuousLogCopyRequest == null)
                     {
                         if (message is ContinuousLogCopyRequest)
                         {
                             continuousLogCopyRequest = LogCopyServerContext.UpgradeRequest(this.Channel, message as ContinuousLogCopyRequest);
                         }
                         else
                         {
                             LogCopyServerContext.Tracer.TraceError <NetworkChannelMessage>((long)this.GetHashCode(), "HandleIncomingMessage: UnexpectedMsg:{0}", message);
                             this.Channel.ThrowUnexpectedMessage(message);
                         }
                     }
                     LogCopyServerContext.Tracer.TraceDebug <long, long, ContinuousLogCopyRequest2.Flags>((long)this.GetHashCode(), "HandleIncomingMessage: First=0x{0:X} Max=0x{1:X} Flags=0x{2:X}", continuousLogCopyRequest.FirstGeneration, continuousLogCopyRequest.LastGeneration, continuousLogCopyRequest.FlagsUsed);
                     this.m_sendDataEnabled    = true;
                     this.m_nextLogCopyRequest = continuousLogCopyRequest;
                 }
                 this.StartNetworkRead();
                 this.SignalWorkPending();
             }
         }
     }
     catch (NetworkTransportException arg)
     {
         LogCopyServerContext.Tracer.TraceError <NetworkTransportException>((long)this.GetHashCode(), "HandleIncomingMessage: Channel exception: {0}", arg);
         this.MarkForTermination();
     }
 }
        private static void NetworkReadComplete(object context, int bytesAvailable, bool completionIsSynchronous, Exception e)
        {
            LogCopyServerContext logCopyServerContext = (LogCopyServerContext)context;

            if (bytesAvailable > 0)
            {
                logCopyServerContext.HandleIncomingMessage();
                return;
            }
            if (e == null)
            {
                LogCopyServerContext.Tracer.TraceDebug((long)logCopyServerContext.GetHashCode(), "NetworkReadComplete: Client closed the channel");
            }
            else
            {
                LogCopyServerContext.Tracer.TraceError <Exception>((long)logCopyServerContext.GetHashCode(), "NetworkReadComplete: Channel exception: {0}", e);
            }
            logCopyServerContext.MarkForTermination();
        }
 // Token: 0x06002265 RID: 8805 RVA: 0x000A04E1 File Offset: 0x0009E6E1
 public override void Execute()
 {
     LogCopyServerContext.StartContinuousLogTransmission(base.Channel, this);
 }
        internal static void StartContinuousLogTransmission(NetworkChannel channel, ContinuousLogCopyRequest2 initialRequest)
        {
            LogCopyServerContext logCopyServerContext = new LogCopyServerContext(channel, channel.MonitoredDatabase);

            logCopyServerContext.InitContinuousLogTransmission(initialRequest);
        }