예제 #1
0
        internal virtual void WaitEvents()
        {
            long num = 0L;

            try
            {
                Lightstreamer.DotNet.Client.ServerUpdateEvent event2;
                bool flag;
                ActivityController activityController = new ActivityController(this);
                activityController.StartKeepalives();
                sessionLogger.Info("Listening for updates on session " + this.localPushServerProxy.SessionId);
                goto Label_0162;
                Label_0038 :;
                try
                {
                    event2 = this.localPushServerProxy.WaitUpdate(activityController);
                }
                catch (PushServerException exception)
                {
                    protLogger.Debug("Error in received data", exception);
                    sessionLogger.Error("Error while listening for data in session " + this.localPushServerProxy.SessionId);
                    this.serverListener.OnDataError(exception);
                    goto Label_0162;
                }
                catch (PushLengthException exception2)
                {
                    long holdingMillis = exception2.HoldingMillis;
                    if (holdingMillis > 0L)
                    {
                        try
                        {
                            Thread.Sleep((int)holdingMillis);
                        }
                        catch (ThreadInterruptedException)
                        {
                        }
                    }
                    if (!this.Rebind(activityController))
                    {
                        return;
                    }
                    activityController.StartKeepalives();
                    goto Label_0162;
                }
                ITableManager updatedTable = this.GetUpdatedTable(event2);
                if (updatedTable == null)
                {
                    if (!this.localPushServerProxy.IsWindowCodeConsumed(event2.WinCode))
                    {
                        this.serverListener.OnDataError(new PushServerException(1));
                    }
                }
                else
                {
                    this.serverListener.OnUpdate(updatedTable, event2);
                }
                long totalBytes = this.localPushServerProxy.TotalBytes;
                this.serverListener.OnNewBytes(totalBytes - num);
                num = totalBytes;
Label_0162:
                flag = true;
                goto Label_0038;
            }
            catch (PushConnException exception3)
            {
                streamLogger.Debug("Error in connection", exception3);
                sessionLogger.Error("Error while listening for data in session " + this.localPushServerProxy.SessionId);
                this.serverListener.OnFailure(exception3);
            }
            catch (PhaseException)
            {
                sessionLogger.Info("Listening loop closed for session " + this.localPushServerProxy.SessionId);
            }
        }
 internal virtual void WaitEvents()
 {
     long num = 0L;
     try
     {
         Lightstreamer.DotNet.Client.ServerUpdateEvent event2;
         bool flag;
         ActivityController activityController = new ActivityController(this);
         activityController.StartKeepalives();
         sessionLogger.Info("Listening for updates on session " + this.localPushServerProxy.SessionId);
         goto Label_0162;
     Label_0038:;
         try
         {
             event2 = this.localPushServerProxy.WaitUpdate(activityController);
         }
         catch (PushServerException exception)
         {
             protLogger.Debug("Error in received data", exception);
             sessionLogger.Error("Error while listening for data in session " + this.localPushServerProxy.SessionId);
             this.serverListener.OnDataError(exception);
             goto Label_0162;
         }
         catch (PushLengthException exception2)
         {
             long holdingMillis = exception2.HoldingMillis;
             if (holdingMillis > 0L)
             {
                 try
                 {
                     Thread.Sleep((int) holdingMillis);
                 }
                 catch (ThreadInterruptedException)
                 {
                 }
             }
             if (!this.Rebind(activityController))
             {
                 return;
             }
             activityController.StartKeepalives();
             goto Label_0162;
         }
         ITableManager updatedTable = this.GetUpdatedTable(event2);
         if (updatedTable == null)
         {
             if (!this.localPushServerProxy.IsWindowCodeConsumed(event2.WinCode))
             {
                 this.serverListener.OnDataError(new PushServerException(1));
             }
         }
         else
         {
             this.serverListener.OnUpdate(updatedTable, event2);
         }
         long totalBytes = this.localPushServerProxy.TotalBytes;
         this.serverListener.OnNewBytes(totalBytes - num);
         num = totalBytes;
     Label_0162:
         flag = true;
         goto Label_0038;
     }
     catch (PushConnException exception3)
     {
         streamLogger.Debug("Error in connection", exception3);
         sessionLogger.Error("Error while listening for data in session " + this.localPushServerProxy.SessionId);
         this.serverListener.OnFailure(exception3);
     }
     catch (PhaseException)
     {
         sessionLogger.Info("Listening loop closed for session " + this.localPushServerProxy.SessionId);
     }
 }