Пример #1
0
        static void Main(string[] args)
        {
            var t = new Thread(() =>
            {
                var s              = new SyncV2("cad587f6-4f06-4c9f-9575-ae500b5f161c", "DOvJHQ-CSB-tBs-u2HhE6RhwT2t6nZZ7");
                s.HandlerMessages += S_HandlerMessages;
                s.HandlerAck      += S_HandlerAck;
                s.HandlerJSON     += S_HandlerJSON;

                s.Connect();

                //int i = 0;
                //while (true)
                //{
                //    Thread.Sleep(TimeSpan.FromSeconds(5));
                //    Console.WriteLine($"Conectado -> {s.IsConnected}");

                //    if (!s.IsConnected)
                //    {
                //        i++;
                //        if (i > 5)
                //        {
                //            s.Dispose();
                //        }
                //    }
                //}
            });

            t.Start();

            Thread.Sleep(Timeout.Infinite);
        }
Пример #2
0
        static void Main(string[] args)
        {
            var t = new Thread(() =>
            {
                var s              = new SyncV2("cad587f6-4f06-4c9f-9575-ae500b5f161c", "DOvJHQ-CSB-tBs-u2HhE6RhwT2t6nZZ7");
                s.HandlerMessages += S_HandlerMessages;
                s.HandlerAck      += S_HandlerAck;
                s.HandlerJSON     += S_HandlerJSON;

                s.Connect();
            });

            t.Start();

            Thread.Sleep(Timeout.Infinite);
        }