public virtual void UnsubscribeTable(Lightstreamer.DotNet.Client.SubscribedTableKey tableKey)
        {
            ServerManager connManager = this.ConnManager;

            Lightstreamer.DotNet.Client.SubscribedTableKey[] subscrKeys = new Lightstreamer.DotNet.Client.SubscribedTableKey[] { tableKey };
            ITableManager[] managerArray = connManager.DetachTables(subscrKeys);
            if (managerArray[0] == null)
            {
                try
                {
                    connManager.UnsubscrTables(new Lightstreamer.DotNet.Client.SubscribedTableKey[0], true);
                }
                catch (PhaseException)
                {
                }
                throw new SubscrException("Table not found");
            }
            managerArray[0].NotifyUnsub();
            try
            {
                connManager.UnsubscrTables(subscrKeys, true);
            }
            catch (PhaseException)
            {
                throw new SubscrException("Connection closed");
            }
        }
        public virtual void ForceUnsubscribeTable(Lightstreamer.DotNet.Client.SubscribedTableKey tableKey)
        {
            ServerManager connManager = this.ConnManager;

            Lightstreamer.DotNet.Client.SubscribedTableKey[] subscrKeys = new Lightstreamer.DotNet.Client.SubscribedTableKey[] { tableKey };
            try
            {
                connManager.UnsubscrTables(subscrKeys, false);
            }
            catch (PhaseException)
            {
                throw new SubscrException("Connection closed");
            }
        }
        internal virtual void RequestSubscr(ITableManager table, Lightstreamer.DotNet.Client.SubscribedTableKey subscrKey, BatchMonitor batch)
        {
            string winCode = subscrKey.KeyValue.ToString();

            this.Check();
            try
            {
                this.serverTranslator.CallTableRequest(this.serverInfo, winCode, table, batch);
            }
            catch (IOException exception)
            {
                throw new PushConnException(exception);
            }
            catch (WebException exception2)
            {
                throw new PushConnException(exception2);
            }
            this.Check();
        }
Beispiel #4
0
        internal virtual Lightstreamer.DotNet.Client.SubscribedTableKey[] SubscrItems(VirtualTableManager table, bool batchable)
        {
            int    num;
            object obj2;

            Lightstreamer.DotNet.Client.SubscribedTableKey[] subscrKeys = new Lightstreamer.DotNet.Client.SubscribedTableKey[table.NumItems];
            actionsLogger.Info(string.Concat(new object[] { "Adding ", table, " to session ", this.localPushServerProxy.SessionId }));
            lock ((obj2 = this.tables.SyncRoot))
            {
                for (num = 0; num < table.NumItems; num++)
                {
                    subscrKeys[num] = this.localPushServerProxy.WindowCode;
                    this.tables[subscrKeys[num].KeyValue] = table.GetItemManager(num);
                }
            }
            bool flag = false;

            try
            {
                this.localPushServerProxy.RequestItemsSubscr(table, subscrKeys, batchable ? this.batchMonitor : null);
                flag = true;
            }
            finally
            {
                if (!flag)
                {
                    actionsLogger.Info(string.Concat(new object[] { "Undoing add of ", table, " to session ", this.localPushServerProxy.SessionId }));
                    lock ((obj2 = this.tables.SyncRoot))
                    {
                        for (num = 0; num < subscrKeys.Length; num++)
                        {
                            this.tables.Remove(subscrKeys[num].KeyValue);
                        }
                    }
                }
            }
            return(subscrKeys);
        }
        public virtual void UnsubscribeTables(Lightstreamer.DotNet.Client.SubscribedTableKey[] tableKeys)
        {
            int           num2;
            ServerManager connManager = this.ConnManager;

            ITableManager[] managerArray = connManager.DetachTables(tableKeys);
            int             num          = 0;

            for (num2 = 0; num2 < managerArray.Length; num2++)
            {
                if (managerArray[num2] != null)
                {
                    managerArray[num2].NotifyUnsub();
                    num++;
                }
            }
            Lightstreamer.DotNet.Client.SubscribedTableKey[] subscrKeys = new Lightstreamer.DotNet.Client.SubscribedTableKey[num];
            int index = 0;

            for (num2 = 0; num2 < managerArray.Length; num2++)
            {
                if (managerArray[num2] != null)
                {
                    subscrKeys[index] = tableKeys[num2];
                    index++;
                }
            }
            try
            {
                connManager.UnsubscrTables(subscrKeys, true);
            }
            catch (PhaseException)
            {
                throw new SubscrException("Connection closed");
            }
        }
Beispiel #6
0
 internal virtual Lightstreamer.DotNet.Client.SubscribedTableKey[] SubscrItems(VirtualTableManager table, bool batchable)
 {
     int i;
     object CS$2$0003;
     if (table.NumItems == 0)
     {
         if (batchable)
         {
             this.UnbatchRequest();
         }
         return new Lightstreamer.DotNet.Client.SubscribedTableKey[0];
     }
     Lightstreamer.DotNet.Client.SubscribedTableKey[] subscrKeys = new Lightstreamer.DotNet.Client.SubscribedTableKey[table.NumItems];
     actionsLogger.Info(string.Concat(new object[] { "Adding ", table, " to session ", this.localPushServerProxy.SessionId }));
     lock ((CS$2$0003 = this.tables.SyncRoot))
     {
         for (i = 0; i < table.NumItems; i++)
         {
             subscrKeys[i] = this.localPushServerProxy.TableCode;
             this.tables[subscrKeys[i].KeyValue] = table.GetItemManager(i);
         }
     }
     bool ok = false;
     try
     {
         this.localPushServerProxy.RequestItemsSubscr(table, subscrKeys, batchable ? this.batchMonitor : null);
         ok = true;
     }
     finally
     {
         if (!ok)
         {
             actionsLogger.Info(string.Concat(new object[] { "Undoing add of ", table, " to session ", this.localPushServerProxy.SessionId }));
             lock ((CS$2$0003 = this.tables.SyncRoot))
             {
                 for (i = 0; i < subscrKeys.Length; i++)
                 {
                     this.tables.Remove(subscrKeys[i].KeyValue);
                 }
             }
         }
     }
     return subscrKeys;
 }
Beispiel #7
0
 public virtual void UnsubscribeTables(Lightstreamer.DotNet.Client.SubscribedTableKey[] tableKeys)
 {
     int i;
     ServerManager currConnManager = this.ConnManager;
     ITableManager[] infos = currConnManager.DetachTables(tableKeys);
     int found = 0;
     for (i = 0; i < infos.Length; i++)
     {
         if (infos[i] != null)
         {
             infos[i].NotifyUnsub();
             found++;
         }
     }
     if (found == 0)
     {
     }
     Lightstreamer.DotNet.Client.SubscribedTableKey[] foundTableKeys = new Lightstreamer.DotNet.Client.SubscribedTableKey[found];
     int curr = 0;
     for (i = 0; i < infos.Length; i++)
     {
         if (infos[i] != null)
         {
             foundTableKeys[curr] = tableKeys[i];
             curr++;
         }
     }
     try
     {
         currConnManager.UnsubscrTables(foundTableKeys, true);
     }
     catch (PhaseException)
     {
         throw new SubscrException("Connection closed");
     }
 }
Beispiel #8
0
 public virtual void UnsubscribeTable(Lightstreamer.DotNet.Client.SubscribedTableKey tableKey)
 {
     ServerManager currConnManager = this.ConnManager;
     if (tableKey.KeyValue != -1)
     {
         Lightstreamer.DotNet.Client.SubscribedTableKey[] tableKeys = new Lightstreamer.DotNet.Client.SubscribedTableKey[] { tableKey };
         ITableManager[] infos = currConnManager.DetachTables(tableKeys);
         if (infos[0] == null)
         {
             try
             {
                 currConnManager.UnsubscrTables(new Lightstreamer.DotNet.Client.SubscribedTableKey[0], true);
             }
             catch (PhaseException)
             {
             }
             throw new SubscrException("Table not found");
         }
         infos[0].NotifyUnsub();
         try
         {
             currConnManager.UnsubscrTables(tableKeys, true);
         }
         catch (PhaseException)
         {
             throw new SubscrException("Connection closed");
         }
     }
 }
Beispiel #9
0
 public virtual void ForceUnsubscribeTable(Lightstreamer.DotNet.Client.SubscribedTableKey tableKey)
 {
     ServerManager currConnManager = this.ConnManager;
     if (tableKey.KeyValue != -1)
     {
         Lightstreamer.DotNet.Client.SubscribedTableKey[] tableKeys = new Lightstreamer.DotNet.Client.SubscribedTableKey[] { tableKey };
         try
         {
             currConnManager.UnsubscrTables(tableKeys, false);
         }
         catch (PhaseException)
         {
             throw new SubscrException("Connection closed");
         }
     }
 }
Beispiel #10
0
 public virtual void UnsubscribeTables(Lightstreamer.DotNet.Client.SubscribedTableKey[] tableKeys)
 {
     int num2;
     ServerManager connManager = this.ConnManager;
     ITableManager[] managerArray = connManager.DetachTables(tableKeys);
     int num = 0;
     for (num2 = 0; num2 < managerArray.Length; num2++)
     {
         if (managerArray[num2] != null)
         {
             managerArray[num2].NotifyUnsub();
             num++;
         }
     }
     if (num == 0)
     {
     }
     Lightstreamer.DotNet.Client.SubscribedTableKey[] subscrKeys = new Lightstreamer.DotNet.Client.SubscribedTableKey[num];
     int index = 0;
     for (num2 = 0; num2 < managerArray.Length; num2++)
     {
         if (managerArray[num2] != null)
         {
             subscrKeys[index] = tableKeys[num2];
             index++;
         }
     }
     try
     {
         connManager.UnsubscrTables(subscrKeys, true);
     }
     catch (PhaseException)
     {
         throw new SubscrException("Connection closed");
     }
 }
 public virtual void UnsubscribeTable(Lightstreamer.DotNet.Client.SubscribedTableKey tableKey)
 {
     ServerManager connManager = this.ConnManager;
     Lightstreamer.DotNet.Client.SubscribedTableKey[] subscrKeys = new Lightstreamer.DotNet.Client.SubscribedTableKey[] { tableKey };
     ITableManager[] managerArray = connManager.DetachTables(subscrKeys);
     if (managerArray[0] == null)
     {
         try
         {
             connManager.UnsubscrTables(new Lightstreamer.DotNet.Client.SubscribedTableKey[0], true);
         }
         catch (PhaseException)
         {
         }
         throw new SubscrException("Table not found");
     }
     managerArray[0].NotifyUnsub();
     try
     {
         connManager.UnsubscrTables(subscrKeys, true);
     }
     catch (PhaseException)
     {
         throw new SubscrException("Connection closed");
     }
 }
 internal virtual Lightstreamer.DotNet.Client.SubscribedTableKey[] SubscrItems(VirtualTableManager table, bool batchable)
 {
     int num;
     object obj2;
     Lightstreamer.DotNet.Client.SubscribedTableKey[] subscrKeys = new Lightstreamer.DotNet.Client.SubscribedTableKey[table.NumItems];
     actionsLogger.Info(string.Concat(new object[] { "Adding ", table, " to session ", this.localPushServerProxy.SessionId }));
     lock ((obj2 = this.tables.SyncRoot))
     {
         for (num = 0; num < table.NumItems; num++)
         {
             subscrKeys[num] = this.localPushServerProxy.WindowCode;
             this.tables[subscrKeys[num].KeyValue] = table.GetItemManager(num);
         }
     }
     bool flag = false;
     try
     {
         this.localPushServerProxy.RequestItemsSubscr(table, subscrKeys, batchable ? this.batchMonitor : null);
         flag = true;
     }
     finally
     {
         if (!flag)
         {
             actionsLogger.Info(string.Concat(new object[] { "Undoing add of ", table, " to session ", this.localPushServerProxy.SessionId }));
             lock ((obj2 = this.tables.SyncRoot))
             {
                 for (num = 0; num < subscrKeys.Length; num++)
                 {
                     this.tables.Remove(subscrKeys[num].KeyValue);
                 }
             }
         }
     }
     return subscrKeys;
 }