コード例 #1
0
        public void SubscribeToNewsHeadlineStream()
        {
            if (!CIAPI_Global.IsConnected)
            {
                CIAPI_Global.ConnectCIAPI();
            }
            newsListener = CIAPI_Global.StreamingClient.BuildNewsHeadlinesListener("NEWS.MOCKHEADLINES.UK");
            newsListener.Start();

            var gate = new ManualResetEvent(false);

            newsListener.MessageReceived += (s, e) =>
            {
                newsReceived(e.Data.StoryId);
                gate.Set();
            };
            gate.WaitOne();
        }
コード例 #2
0
        public void SubscribeToPrice(object marketId)
        {
            if (!CIAPI_Global.IsConnected)
            {
                CIAPI_Global.ConnectCIAPI();
            }

            priceListner = CIAPI_Global.StreamingClient.BuildPriceListener("PRICES.PRICE." + marketId);//marketIDs[i]);
            priceListner.Start();

            var gate = new ManualResetEvent(false);

            priceListner.MessageReceived += (sender, priceArg) =>
            {
                OnPriceReceived(new PriceReceivedArgs(priceArg.Data));
                gate.Set();
            };
            gate.WaitOne();
        }
コード例 #3
0
 public void UnSubscribeNewsHeadLineStream()
 {
     newsListener.Stop();
     CIAPI_Global.DisConnectCIAPI();
 }