Ejemplo n.º 1
0
        static void ConnectToWCF()
        {
            try
            {
                proxy = new localhost.PokeInWCF();
                bool b;
                proxy.PingAlive(out b, out b);

                ServerConnected = true;

                /* ConnectToWCF method call
                 * made by static constructor or CheckMessage function?
                 * 
                 * Check, if there is an existing worker thread
                 */
                if (workerThread == null)
                {
                    workerThread = new System.Threading.Thread(CheckMessages);
                    workerThread.Start();
                }

                CometWorker.SendToAll("UpdateServiceStatus(" + ServerConnected.ToString().ToLower() + ");");

                string[] clientIds = CometWorker.GetClientIds();
                if (clientIds != null)
                    proxy.AddClients(clientIds); 
            }
            catch
            {
                //Connection Issue re-try after 1.5 secs
                Thread.Sleep(1500);
                ConnectToWCF();
            }  
        }
Ejemplo n.º 2
0
        public void GetWCFServerTime()
        {
            try
            {
                localhost.PokeInWCF proxy = new localhost.PokeInWCF();
                proxy.Timeout = 1500;

                PokeIn.Comet.CometWorker.SendToClient(ClientId, "WCFInfo('" + proxy.TestMethod(ClientId) + "');");
            }
            catch
            {
                PokeIn.Comet.CometWorker.SendToClient(ClientId, "WCFInfo('<font color=\\\'red\\\'>Run WCF Server Project</font>');");
            }
        }
Ejemplo n.º 3
0
        public void GetWCFServerTime()
        {
            try
            {
                localhost.PokeInWCF proxy = new localhost.PokeInWCF();
                proxy.Timeout = 1500;

                PokeIn.Comet.CometWorker.SendToClient(ClientId, "WCFInfo('" + proxy.TestMethod(ClientId) + "');");
            }
            catch
            {
                PokeIn.Comet.CometWorker.SendToClient(ClientId, "WCFInfo('<font color=\\\'red\\\'>Run WCF Server Project</font>');");
            }
        }
Ejemplo n.º 4
0
        static void ConnectToWCF()
        {
            try
            {
                proxy = new localhost.PokeInWCF();
                bool b;
                proxy.PingAlive(out b, out b);

                ServerConnected = true;

                /* ConnectToWCF method call
                 * made by static constructor or CheckMessage function?
                 *
                 * Check, if there is an existing worker thread
                 */
                if (workerThread == null)
                {
                    workerThread = new System.Threading.Thread(CheckMessages);
                    workerThread.Start();
                }

                CometWorker.SendToAll("UpdateServiceStatus(" + ServerConnected.ToString().ToLower() + ");");

                string[] clientIds = CometWorker.GetClientIds();
                if (clientIds != null)
                {
                    proxy.AddClients(clientIds);
                }
            }
            catch
            {
                //Connection Issue re-try after 1.5 secs
                Thread.Sleep(1500);
                ConnectToWCF();
            }
        }