Ejemplo n.º 1
0
        private void RunDataTransportTest()
        {
            var nboot = new NinjectBootstrapper();
            nboot.Start();

            var svc = nboot.Get<IDataTransportService>();

            var student = new Student()
            {
                FirstName = "Clint",
                LastName = "Pearson",
            };

            var person = svc.MapLTR(student, new Person());

            var s = "";
        }
Ejemplo n.º 2
0
        private void Run()
        {
            var nboot = new NinjectBootstrapper();
            nboot.Start();

            Console.WriteLine("Starting incoming comms...");

            _incoming = new TcpIncomingCommsLink<ISimpleProcNode_Comms>(
                new TCPEndpointDetails()
                {
                    Address = IPAddress.Loopback,
                    Port = 8080,
                }, new XmlCommsMessageReaderWriter(new BinaryFormatterCommsMessageFormatter()),
                new DirectInvocationCommsMessageProcessor());

            _incoming.StartListening(this);
            Console.WriteLine("Now listening on port 8080...");

            Console.WriteLine("Initialising host...");
            _host = nboot.Get<IProcessHostFactory>()
                .CreateHostFromType(typeof(SimpleProcess));
            _host.Initialise();

            Console.WriteLine("Host initialised, process details:");
            Console.WriteLine("\t{0}", _host.Metadata.Name);
            Console.WriteLine("\t{0}", _host.Metadata.Description);
            Console.WriteLine("\t{0}", _host.Metadata.Version.ToString("#.#"));
            Console.WriteLine();

            Console.WriteLine("<ENTER> to terminate");
            Console.ReadLine();

            _incoming.StopListening();
            _incoming = null;
            _host.Unitialise();
            _host = null;
        }