Exemplo n.º 1
0
        private static void PauseAndRetry(int ph, Exception ee)
        {
            Debug.WriteLine("Lightstreamer Client, unable to start: " + ee);

            lastDelay *= 2;
            // Probably a connection issue, ask myself to respawn
            for (int i = lastDelay; i > 0; i--)
            {
                if (!checkPhase(ph))
                {
                    return;
                }

                if (!System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable())
                {
                    listener.OnStatusChange(ph, LightstreamerConnectionHandler.CONNECTING, "Network unavailble, next check in " + i + " seconds");
                }
                else
                {
                    listener.OnStatusChange(ph, LightstreamerConnectionHandler.CONNECTING, "Connection failed, retrying in " + i + " seconds");
                }

                Thread.Sleep(1000);
            }


            Debug.WriteLine("Trying to respawn Lightstreamer Client");
            listener.OnReconnectRequest(ph);
            return;
        }
Exemplo n.º 2
0
 public void AutomaticReconnect()
 {
     listener.OnReconnectRequest(phase);
 }