Example #1
0
 public void GlueConfiguredByCode()
 {
     //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 SyncBinding(glue, "sync");
         var cl = new JokeContractClient(glue, TestServerSyncNode);
     }
     finally
     {
         glue.WaitForCompleteStop();
     }
 }
Example #2
0
        protected internal override ServerTransport OpenServerEndpoint(ServerEndPoint epoint)
        {
            var cfg = ConfigNode.NavigateSection(CONFIG_SERVER_TRANSPORT_SECTION);

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

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

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

            return(transport);
        }
Example #3
0
        public void GlueConfiguredByCodeAndMakeCall_Sync()
        {
            //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(app);
            glue.Start();
            try
            {
                using(var binding = new SyncBinding(glue, "sync"))
                {
                  binding.Start();
                  var cl = new JokeContractClient(glue, TestServerSyncNode);
                  cl.Headers.Add( new AuthenticationHeader( TestCredentials ) );

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

                  Assert.IsTrue(result.StartsWith("Server echoed Gello A!"));
                }
            }
            finally
            {
                glue.WaitForCompleteStop();
            }
        }