示例#1
0
        private static void Start(int ph)
        {
            while (listener == null)
            {
                //or we may use a different listener that will pass the received values to
                //the front-end once the front-end is ready
                Thread.Sleep(500);
            }

            if (!System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable())
            {
                PauseAndRetry(ph, null);
                return;
            }

            try
            {
                if (!checkPhase(ph))
                {
                    return;
                }

                listener.OnStatusChange(ph, LightstreamerConnectionHandler.CONNECTING, "Connecting to " + pushServerHost);

                LightStreamer.Start(pushServerHost, phase, listener);
                Debug.WriteLine("Lightstreamer Client Started");
                lastDelay = 1;

                if (!checkPhase(ph))
                {
                    return;
                }

                LightStreamer.Subscribe(ph, listener);
            }

            catch (PushConnException pce)
            {
                PauseAndRetry(ph, pce);
            }
            catch (SubscrException se)
            {
                PauseAndRetry(ph, se);
            }
        }
示例#2
0
 public void OnConnectionEstablished()
 {
     listener.OnStatusChange(phase, LightstreamerConnectionHandler.CONNECTED, "Connected to Lightstreamer Server...");
 }