public void Subscribe(int phase, ILightstreamerListener listener)
        {

            StocklistHandyTableListener hl = new StocklistHandyTableListener(listener, phase);


            var simpleTableInfo = new SimpleTableInfo("PRICE.400535967 81136 400509294 400535971 80902 400509295 400193864 400525367 80926 400498641 400193866 91047 400194551 121766 400172033 139144", mode: "RAW", schema: "AuditId Bid Change Direction High Low MarketId Offer Price TickDate", snap: false) { DataAdapter = "PRICES" };
            client.SubscribeTable(simpleTableInfo, hl, false);
        }
        public virtual Lightstreamer.DotNet.Client.SubscribedTableKey SubscribeTable(SimpleTableInfo table, IHandyTableListener listener, bool commandLogic)
        {
            Lightstreamer.DotNet.Client.SubscribedTableKey key;
            ServerManager connManager = this.ConnManager;
            ITableManager manager2    = new FullTableManager(table, listener, commandLogic);

            try
            {
                key = connManager.SubscrTable(manager2, true);
            }
            catch (PhaseException)
            {
                throw new SubscrException("Connection closed");
            }
            return(key);
        }
 internal FullTableManager(SimpleTableInfo table, IHandyTableListener listener, bool doCommandLogic)
 {
     this.baseInfo = (SimpleTableInfo) table.Clone();
     this.isCommandLogic = doCommandLogic;
     if (table is ExtendedTableInfo)
     {
         this.extInfo = (ExtendedTableInfo) this.baseInfo;
         this.fieldIndexMap = new Dictionary<string, int>();
         for (int i = 0; i < this.extInfo.fields.Length; i++)
         {
             this.fieldIndexMap[this.extInfo.fields[i]] = i;
         }
     }
     else
     {
         this.extInfo = null;
         this.fieldIndexMap = null;
     }
     this.listener = listener;
 }
 internal FullTableManager(SimpleTableInfo table, IHandyTableListener listener, bool doCommandLogic)
 {
     this.baseInfo       = table;
     this.isCommandLogic = doCommandLogic;
     if (table is ExtendedTableInfo)
     {
         this.extInfo       = (ExtendedTableInfo)table;
         this.fieldIndexMap = new Hashtable();
         for (int i = 0; i < this.extInfo.fields.Length; i++)
         {
             this.fieldIndexMap[this.extInfo.fields[i]] = i;
         }
     }
     else
     {
         this.extInfo       = null;
         this.fieldIndexMap = null;
     }
     this.listener = listener;
 }
Exemple #5
0
 public virtual Lightstreamer.DotNet.Client.SubscribedTableKey SubscribeTable(SimpleTableInfo table, IHandyTableListener listener, bool commandLogic)
 {
     Lightstreamer.DotNet.Client.SubscribedTableKey CS$1$0000;
     ServerManager currConnManager = this.ConnManager;
     ITableManager tableInfo = new FullTableManager(table, listener, commandLogic);
     try
     {
         CS$1$0000 = currConnManager.SubscrTable(tableInfo, true);
     }
     catch (PhaseException)
     {
         throw new SubscrException("Connection closed");
     }
     return CS$1$0000;
 }
Exemple #6
0
 public virtual SubscribedTableKey SubscribeTable(SimpleTableInfo table, IHandyTableListener listener, bool commandLogic)
 {
     SubscribedTableKey key;
     ServerManager connManager = this.ConnManager;
     ITableManager manager2 = new FullTableManager(table, listener, commandLogic);
     try
     {
         key = connManager.SubscrTable(manager2, true);
     }
     catch (PhaseException)
     {
         throw new SubscrException("Connection closed");
     }
     return key;
 }
        private void subscribe() {
            lock (this)
            {
                //this method will try just one subscription.
                //we know that when this method executes we should be already connected
                //If we're not or we disconnect while subscribing we don't have to do anything here as an
                //event will be (or was) sent to the ConnectionListener that will handle the case.
                //If we're connected but the subscription fails we can't do anything as the same subscription 
                //would fail again and again (btw this should never happen)

                try
                {
                    SimpleTableInfo tableInfo = new SimpleTableInfo(
                        "item1 item2 item3 item4 item5 item6 item7 item8 item9 item10 item11 item12 item13 item14 item15 item16 item17 item18 item19 item20 item21 item22 item23 item24 item25 item26 item27 item28 item29 item30",
                        "MERGE",
                        "stock_name last_price time pct_change bid_quantity bid ask ask_quantity min max ref_price open_price",
                        true);
                    tableInfo.DataAdapter = "QUOTE_ADAPTER";

                    client.SubscribeTable(
                        tableInfo,
                        new StocklistHandyTableListener(this, this.phase),
                        false);

                }
                catch (SubscrException)
                {
                }
                catch (PushServerException)
                {
                }
                catch (PushUserException)
                {
                }
                catch (PushConnException)
                {
                }
            }
        }
 internal SimpleTableManager(SimpleTableInfo table, ISimpleTableListener listener)
 {
     this.table = (SimpleTableInfo) table.Clone();
     this.listener = listener;
 }
 internal SimpleTableManager(SimpleTableInfo table, ISimpleTableListener listener)
 {
     this.table = table;
     this.listener = listener;
 }
Exemple #10
0
 public virtual Lightstreamer.DotNet.Client.SubscribedTableKey SubscribeTable(SimpleTableInfo table, ISimpleTableListener listener)
 {
     Lightstreamer.DotNet.Client.SubscribedTableKey key;
     ServerManager connManager = this.ConnManager;
     ITableManager manager2 = new SimpleTableManager(table, listener);
     try
     {
         key = connManager.SubscrTable(manager2, true);
     }
     catch (PhaseException)
     {
         throw new SubscrException("Connection closed");
     }
     return key;
 }
 internal SimpleTableManager(SimpleTableInfo table, ISimpleTableListener listener)
 {
     this.table    = table;
     this.listener = listener;
 }