コード例 #1
0
        public void MakeConnection()
        {
            String uri = "tcp://localhost:4010";

            MainHelloWorldClient client = new MainHelloWorldClient();

            server = HelloWorldHelper.NewServer(uri, null, client);

            server._StartAndWaitUp(4000);
        }
コード例 #2
0
ファイル: MainHelloWorldListener.cs プロジェクト: NeoTim/etch
        ///<summary>Main for HelloWorldListener.</summary>
        ///<param name="args">Command Line Arguments</param>
        public static void Main(String[] args)
        {
            // TODO: Change to correct URI
            //string uri = "udp://127.0.0.1:4001";
            string uri = "tcp://127.0.0.1:4001";

            ServerFactory listener = HelloWorldHelper.NewListener(uri, null, new MainHelloWorldListener());

            // Start the Listener
            listener.TransportControl(TransportConsts.START_AND_WAIT_UP, 400000);
        }
コード例 #3
0
        public void StartListener()
        {
            String uri = "tcp://localhost:4010";

            MainHelloWorldListener implFactory = new MainHelloWorldListener();

            listener = HelloWorldHelper.NewListener(uri, null, implFactory);

            listener.TransportControl(TransportConsts.START_AND_WAIT_UP, 4000);

            Console.WriteLine("Listener Started");
        }
コード例 #4
0
ファイル: MainHelloWorldClient.cs プロジェクト: NeoTim/etch
        ///<summary>Main for HelloWorldClient</summary>
        ///<param name="args">Command Line Arguments</param>
        public static void Main(String[] args)
        {
            // TODO: Change to correct URI
            //string uri = "udp://127.0.0.1:4001";
            string uri = "tcp://127.0.0.1:4001";

            RemoteHelloWorldServer server = HelloWorldHelper.NewServer(uri, null, new MainHelloWorldClient());

            // Connect to the service
            server._StartAndWaitUp(4000);

            org.apache.etch.examples.helloworld.types.HelloWorld.user theUser = new user(5, "User");
            string s = server.say_hello(theUser);

            Console.Write(s);

            // Disconnect from the service
            server._StopAndWaitDown(4000);
        }