示例#1
0
文件: MpxBinding.cs 项目: zhabis/nfx
        protected internal override ServerTransport OpenServerEndpoint(ServerEndPoint epoint)
        {
            var cfg = ConfigNode.NavigateSection(CONFIG_SERVER_TRANSPORT_SECTION);

            if (!cfg.Exists)
            {
                cfg = ConfigNode;
            }

            var ipep      = MpxBinding.ToIPEndPoint(epoint.Node);
            var transport = new MpxServerTransport(this, epoint, ipep.Address, ipep.Port);

            transport.Configure(cfg);
            transport.Start();

            return(transport);
        }
示例#2
0
        public void GlueConfiguredByCodeAndMakeCall_MPX()
        {
            //This is an example of how to use Glue without pre-configured app container
            var app = new TestApplication(){ Active = true };
            var glue = new NFX.Glue.Implementation.GlueService();
            glue.Start();
            try
            {
                using(var binding = new MpxBinding(glue, "mpx"))
                {
                  binding.Start();
                  var cl = new JokeContractClient(glue, TestServerMpxNode);
                  cl.Headers.Add( new AuthenticationHeader( TestCredentials ) );

                  var result = cl.Echo("Gello A!");

                  Assert.IsTrue(result.StartsWith("Server echoed Gello A!"));
                }
            }
            finally
            {
                glue.WaitForCompleteStop();
            }
        }
示例#3
0
        public void GlueConfiguredByCode_MPX()
        {
            //This is an example of how to use Glue without pre-configured app container
            var glue = new NFX.Glue.Implementation.GlueService();
            glue.Start();
            try
            {
                var binding = new MpxBinding(glue, "mpx");
                var cl = new JokeContractClient(glue, TestServerMpxNode);

            }
            finally
            {
                glue.WaitForCompleteStop();
            }
        }