コード例 #1
0
        public void Run()
        {
            try
            {
                tcp = new TcpChannel(0);

                Hashtable options = new Hashtable();
                options ["timeout"] = 10000; // 10s
                http = new HttpClientChannel(options, null);

                ChannelServices.RegisterChannel(tcp);
                ChannelServices.RegisterChannel(http);

                AppDomain domain = BaseCallTest.CreateDomain("testdomain_activation");
                server = (ActivationServer)domain.CreateInstanceAndUnwrap(GetType().Assembly.FullName, "MonoTests.Remoting.ActivationServer");

                RemotingConfiguration.RegisterActivatedClientType(typeof(CaObject1), "tcp://localhost:9433");
                RemotingConfiguration.RegisterActivatedClientType(typeof(CaObject2), "http://localhost:9434");
                RemotingConfiguration.RegisterWellKnownClientType(typeof(WkObjectSinglecall1), "tcp://localhost:9433/wkoSingleCall1");
                RemotingConfiguration.RegisterWellKnownClientType(typeof(WkObjectSingleton1), "tcp://localhost:9433/wkoSingleton1");
                RemotingConfiguration.RegisterWellKnownClientType(typeof(WkObjectSinglecall2), "http://localhost:9434/wkoSingleCall2");
                RemotingConfiguration.RegisterWellKnownClientType(typeof(WkObjectSingleton2), "http://localhost:9434/wkoSingleton2");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }
コード例 #2
0
ファイル: ActivationTests.cs プロジェクト: nlhepler/mono
		public void Run()
		{
			try
			{
				tcp =  new TcpChannel (0);
				
				Hashtable options = new Hashtable ();
				options ["timeout"] = 10000; // 10s
				http = new HttpClientChannel (options, null);
			
				ChannelServices.RegisterChannel (tcp);
				ChannelServices.RegisterChannel (http);
			
				AppDomain domain = BaseCallTest.CreateDomain ("testdomain_activation");
				server = (ActivationServer) domain.CreateInstanceAndUnwrap(GetType().Assembly.FullName,"MonoTests.Remoting.ActivationServer");
				
				RemotingConfiguration.RegisterActivatedClientType (typeof(CaObject1), "tcp://localhost:9433");
				RemotingConfiguration.RegisterActivatedClientType (typeof(CaObject2), "http://localhost:9434");
				RemotingConfiguration.RegisterWellKnownClientType (typeof(WkObjectSinglecall1), "tcp://localhost:9433/wkoSingleCall1");
				RemotingConfiguration.RegisterWellKnownClientType (typeof(WkObjectSingleton1), "tcp://localhost:9433/wkoSingleton1");
				RemotingConfiguration.RegisterWellKnownClientType (typeof(WkObjectSinglecall2), "http://localhost:9434/wkoSingleCall2");
				RemotingConfiguration.RegisterWellKnownClientType (typeof(WkObjectSingleton2), "http://localhost:9434/wkoSingleton2");
			}
			catch (Exception ex)
			{
				Console.WriteLine (ex);
			}
		}
コード例 #3
0
        public void Run()
        {
            try
            {
                Hashtable tcpOptions = new Hashtable();
                tcpOptions ["port"]   = 0;
                tcpOptions ["bindTo"] = "127.0.0.1";
                tcp = new TcpChannel(tcpOptions, null, null);

                Hashtable options = new Hashtable();
                options ["timeout"] = 10000;                 // 10s
                http = new HttpClientChannel(options, null);

                ChannelServices.RegisterChannel(tcp);
                ChannelServices.RegisterChannel(http);

                AppDomain domain = BaseCallTest.CreateDomain("testdomain_activation");
                server = (ActivationServer)domain.CreateInstanceAndUnwrap(GetType().Assembly.FullName, "MonoTests.Remoting.ActivationServer");

                var tcpUrlPrefix  = $"tcp://127.0.0.1:{server.TcpPort}";
                var httpUrlPrefix = $"http://127.0.0.1:{server.HttpPort}";
                RemotingConfiguration.RegisterActivatedClientType(typeof(CaObject1), tcpUrlPrefix);
                RemotingConfiguration.RegisterActivatedClientType(typeof(CaObject2), httpUrlPrefix);
                RemotingConfiguration.RegisterWellKnownClientType(typeof(WkObjectSinglecall1), tcpUrlPrefix + "/wkoSingleCall1");
                RemotingConfiguration.RegisterWellKnownClientType(typeof(WkObjectSingleton1), tcpUrlPrefix + "/wkoSingleton1");
                RemotingConfiguration.RegisterWellKnownClientType(typeof(WkObjectSinglecall2), httpUrlPrefix + "/wkoSingleCall2");
                RemotingConfiguration.RegisterWellKnownClientType(typeof(WkObjectSingleton2), httpUrlPrefix + "/wkoSingleton2");
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }