Exemple #1
0
        public static void Main(string[] args)
        {
            if (args.Length != 1)
            {
                Console.WriteLine("Please specify the nameservice url either as ior or corbaloc");
            }
            string nameServiceUrl = args[0];

            // register the channel
            int         port = 8087;
            IiopChannel chan = new IiopChannel(port);

            ChannelServices.RegisterChannel(chan, false);

            AdderImpl adder     = new AdderImpl();
            string    objectURI = "adder";

            RemotingServices.Marshal(adder, objectURI);

            // publish the adder with an external name service
            NamingContext nameService = (NamingContext)RemotingServices.Connect(typeof(NamingContext),
                                                                                nameServiceUrl);

            NameComponent[] name = new NameComponent[] { new NameComponent("adder") };
            nameService.bind(name, adder);
            Console.WriteLine("server running");
            Console.ReadLine();

            // unpublish with external name service
            nameService.unbind(name);
        }
		public static void Main(string[] args) {
                        if (args.Length != 1) {
                            Console.WriteLine("Please specify the nameservice url either as ior or corbaloc");
                        }
                        string nameServiceUrl = args[0];

			// register the channel
			int port = 8087;
			IiopChannel chan = new IiopChannel(port);
			ChannelServices.RegisterChannel(chan, false);
		
			AdderImpl adder = new AdderImpl();
			string objectURI = "adder";
			RemotingServices.Marshal(adder, objectURI);

			// publish the adder with an external name service
                        NamingContext nameService = (NamingContext)RemotingServices.Connect(typeof(NamingContext),
                                                                                            nameServiceUrl);
			NameComponent[] name = new NameComponent[] { new NameComponent("adder") };
			nameService.bind(name, adder);
			Console.WriteLine("server running");
			Console.ReadLine();

			// unpublish with external name service
                        nameService.unbind(name);
		}
		public static void Main(string[] args) {
			// register the channel
			int port = 8087;
			IiopChannel chan = new IiopChannel(port);
			ChannelServices.RegisterChannel(chan, false);
		
			AdderImpl adder = new AdderImpl();
			string objectURI = "adder";
			RemotingServices.Marshal(adder, objectURI);
			
			Console.WriteLine("server running");
			Console.ReadLine();
		}
Exemple #4
0
        public static void Main(string[] args)
        {
            // register the channel
            int         port = 8087;
            IiopChannel chan = new IiopChannel(port);

            ChannelServices.RegisterChannel(chan, false);

            AdderImpl adder     = new AdderImpl();
            string    objectURI = "adder";

            RemotingServices.Marshal(adder, objectURI);

            Console.WriteLine("server running");
            Console.ReadLine();
        }
		public static void Main(string[] args) {
			// register the channel
			int port = 8087;
                        if (args.Length > 0) {
                            port = Int32.Parse(args[0]);
                        }
			IiopChannel chan = new IiopChannel(port);
			ChannelServices.RegisterChannel(chan, false);
		
			AdderImpl adder = new AdderImpl();
			string objectURI = "adder";
			RemotingServices.Marshal(adder, objectURI);
			
			Console.WriteLine("server running");
			Thread.Sleep(Timeout.Infinite);
		}
Exemple #6
0
        public static void Main(string[] args)
        {
            // register the channel
            IDictionary props = new Hashtable();

            props[IiopChannel.CHANNEL_NAME_KEY]      = "securedServerIiopChannel";
            props[IiopServerChannel.PORT_KEY]        = "8087";
            props[IiopChannel.TRANSPORT_FACTORY_KEY] =
                "Ch.Elca.Iiop.Security.Ssl.SslTransportFactory,SSLPlugin";

            props[SslTransportFactory.SERVER_REQUIRED_OPTS]  = "96";
            props[SslTransportFactory.SERVER_SUPPORTED_OPTS] = "96";
            props[SslTransportFactory.SERVER_AUTHENTICATION] =
                "Ch.Elca.Iiop.Security.Ssl.DefaultServerAuthenticationImpl,SSLPlugin";

            props[DefaultServerAuthenticationImpl.SERVER_CERTIFICATE] =
                "5f4abc1aad19e53857be2a4bbec9297091f0082c";
            props[DefaultServerAuthenticationImpl.STORE_LOCATION] = "CurrentUser";

            IiopChannel chan = new IiopChannel(props);

            ChannelServices.RegisterChannel(chan, false);

            AdderImpl adder     = new AdderImpl();
            string    objectURI = "adder";

            RemotingServices.Marshal(adder, objectURI);

            // write out ior to file
            OrbServices orb = OrbServices.GetSingleton();
            string      ior = orb.object_to_string(adder);

            TextWriter writer = new StreamWriter(@"ior");

            writer.WriteLine(ior);
            writer.Close();
            Console.WriteLine("server ior: " + ior.ToString());

            Console.WriteLine("server running");
            Thread.Sleep(Timeout.Infinite);
        }
Exemple #7
0
        public static void Main(string[] args)
        {
            // register the channel
            int port = 8087;

            if (args.Length > 0)
            {
                port = Int32.Parse(args[0]);
            }
            IiopChannel chan = new IiopChannel(port);

            ChannelServices.RegisterChannel(chan, false);

            AdderImpl adder     = new AdderImpl();
            string    objectURI = "adder";

            RemotingServices.Marshal(adder, objectURI);

            Console.WriteLine("server running");
            Thread.Sleep(Timeout.Infinite);
        }
        public static void Main(string[] args) {
            // register the channel            
            IDictionary props = new Hashtable();
            props[IiopChannel.CHANNEL_NAME_KEY] = "securedServerIiopChannel";            
            props[IiopServerChannel.PORT_KEY] = "8087";            
            props[IiopChannel.TRANSPORT_FACTORY_KEY] = 
                "Ch.Elca.Iiop.Security.Ssl.SslTransportFactory,SSLPlugin";
 
            props[SslTransportFactory.SERVER_REQUIRED_OPTS] = "96";
            props[SslTransportFactory.SERVER_SUPPORTED_OPTS] = "96";
            props[SslTransportFactory.SERVER_AUTHENTICATION] = 
                "Ch.Elca.Iiop.Security.Ssl.DefaultServerAuthenticationImpl,SSLPlugin";

            props[DefaultServerAuthenticationImpl.SERVER_CERTIFICATE] = 
                "5f4abc1aad19e53857be2a4bbec9297091f0082c";
            props[DefaultServerAuthenticationImpl.STORE_LOCATION] = "CurrentUser";

            IiopChannel chan = new IiopChannel(props);
            ChannelServices.RegisterChannel(chan, false);
        
            AdderImpl adder = new AdderImpl();
            string objectURI = "adder";
            RemotingServices.Marshal(adder, objectURI);
            
            // write out ior to file
            OrbServices orb = OrbServices.GetSingleton();
            string ior = orb.object_to_string(adder);

            TextWriter writer = new StreamWriter(@"ior");
            writer.WriteLine(ior);
            writer.Close();
            Console.WriteLine("server ior: " + ior.ToString());

            Console.WriteLine("server running");
            Thread.Sleep(Timeout.Infinite);
        }