Esempio n. 1
0
        public void Should_call_remote_console()
        {
            StartConsoleHost();

            var testHandler = new CallbackHandler();
            var svcProxy    = new ConsoleRunnerClient(new InstanceContext(testHandler));
            var startMsg    = new StartExecutionMessage("ping.exe");

            startMsg.Arguments = "localhost";
            svcProxy.Run(startMsg);

            // wait for completion
            while (!testHandler.IsComplete)
            {
                Thread.Sleep(100);
            }
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            var                   cmdLineHandler = new CommandLineHandler(args);
            CommandSwitches       switches       = cmdLineHandler.GetSwitches();
            StartExecutionMessage startMsg       = cmdLineHandler.CreateStartExecutionMessageFromCommandLine();

            EndpointAddress   endpointAddress = new EndpointAddress(switches.EndpointAddress);
            WSDualHttpBinding serviceBinding  = new WSDualHttpBinding();

            if (startMsg.Timeout > 0)
            {
                serviceBinding.ReceiveTimeout = TimeSpan.FromSeconds(startMsg.Timeout);
            }

            var callbackHandler = new ConsoleCallbackHandler();
            var svcProxy        = new ConsoleRunnerClient(new InstanceContext(callbackHandler), serviceBinding, endpointAddress);

            svcProxy.Run(startMsg);

            while (!callbackHandler.IsComplete)
            {
                Thread.Sleep(100);
            }
        }