Exemplo n.º 1
0
        public static void SuiSnail(string[] args)
        {
            // The main task simply starts a client and a server, and then
            // waits for the client to signal that it has died:

            using (var context = new ZContext())
                using (var pubpipe = new ZActor(context, SuiSnail_Publisher))
                    using (var subpipe = new ZActor(context, SuiSnail_Subscriber))
                    {
                        pubpipe.Start();
                        subpipe.Start();

                        subpipe.Frontend.ReceiveFrame();
                        pubpipe.Frontend.Send(new ZFrame("break"));

                        // wait for the Thread (you'll see how fast it is)
                        pubpipe.Join(5000);
                    }
        }
Exemplo n.º 2
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Slow Subscriber Detection");
            // The main task simply starts a client and a server, and then
            // waits for the client to signal that it has died:

            using (var context = new ZContext())
                using (var pubpipe = new ZActor(context, SuiSnail_Publisher))
                    using (var subpipe = new ZActor(context, SuiSnail_Subscriber))
                    {
                        pubpipe.Start();
                        subpipe.Start();

                        subpipe.Frontend.ReceiveFrame();
                        pubpipe.Frontend.Send(new ZFrame("break"));

                        // wait for the Thread (you'll see how fast it is)
                        pubpipe.Join(5000);
                    }

            Console.WriteLine("Press any key to exit...");
            Console.ReadLine();
        }