Esempio n. 1
0
        ///
        /// <summary>Main for FooListener.</summary>
        /// <param name="args"></param>
        ///
        public static void Main1(String[] args)
        {
            string uri = "tcp://localhost:4001";


            MainFooListener implFactory = new MainFooListener();
            ServerFactory   listener    = FooHelper.NewListener(uri, null, implFactory);

            listener.TransportControl(TransportConsts.START_AND_WAIT_UP, 4000);
        }
Esempio n. 2
0
        ///
        /// <summary>Main for FooClient</summary>
        /// <param name="args"></param>
        ///
        public static void Main(String[] args)
        {
            string uri = "tcp://localhost:4001";

            MainFooListener.Main1(null);

            MainFooClient   implFactory = new MainFooClient();
            RemoteFooServer server      = FooHelper.NewServer(uri, null, implFactory);

            server._TransportControl(TransportConsts.START_AND_WAIT_UP, 4000);

            // Insert Your Code Here
            //---------------------------------------------------------------------
            StrStrHashMap bazTable = new StrStrHashMap();

            bazTable.Add("def", "baz");

            StrStrHashMap barTable = new StrStrHashMap();

            barTable.Add("def", "bar");

            StrStrHashMap fooTable = new StrStrHashMap();

            fooTable.Add("def", "foo");

            BazData bazData = new BazData(1, bazTable);
            BarData barData = new BarData(2, barTable, bazData);
            FooData fooData = new FooData(3, fooTable, barData, bazData);

            bool?ok;

            ok = server.baz1(bazData);
            Console.WriteLine("baz1 => " + ok);

            ok = server.baz2(bazData);
            Console.WriteLine("baz2 => " + ok);

            ok = server.bar1(barData);
            Console.WriteLine("bar1 => " + ok);

            ok = server.bar2(barData);
            Console.WriteLine("bar2 => " + ok);

            ok = server.foo1(fooData);
            Console.WriteLine("foo1 => " + ok);

            ok = server.foo2(fooData);
            Console.WriteLine("foo2 => " + ok);

            server._TransportControl(TransportConsts.STOP_AND_WAIT_DOWN, 4000);
        }