예제 #1
0
        private void ServerStartupRemoting()
        {
            SoapClientFormatterSinkProvider clientSinkProvider = new SoapClientFormatterSinkProvider();
            IDictionary props = new Hashtable();

            props["typeFilterLevel"] = "Full";

            SoapServerFormatterSinkProvider serverSinkProvider =
                new SoapServerFormatterSinkProvider(props, null);
            ClientIpServerSinkProvider clientIpSinkProvider =
                new ClientIpServerSinkProvider(props, null);

            serverSinkProvider.Next = clientIpSinkProvider;


            props["port"] = ServerPort;
            props["name"] = "ServerChannel";
            HttpChannel chan = new HttpChannel(props, clientSinkProvider, serverSinkProvider);
            string      name = chan.ChannelName;

            ChannelServices.RegisterChannel(chan, false);


            if (System.IO.File.Exists(configFile))
            {
                RemotingConfiguration.Configure(configFile, false);
            }
            else
            {
                MessageBox.Show("Missing config file:\r\n" + configFile);
            }

            RemotingConfiguration.RegisterWellKnownServiceType(
                typeof(Allberg.Shooter.WinShooterServer.ClientInterface),
                "WinShooterServer",
                WellKnownObjectMode.Singleton);
        }
예제 #2
0
		private void ServerStartupRemoting()
		{
			SoapClientFormatterSinkProvider clientSinkProvider = new SoapClientFormatterSinkProvider();
			IDictionary props = new Hashtable();
			props["typeFilterLevel"] = "Full";

			SoapServerFormatterSinkProvider serverSinkProvider =
				new SoapServerFormatterSinkProvider(props, null);
			ClientIpServerSinkProvider clientIpSinkProvider =
				new ClientIpServerSinkProvider(props, null);
			serverSinkProvider.Next = clientIpSinkProvider;


			props["port"] = ServerPort;
			props["name"] = "ServerChannel";
			HttpChannel chan = new HttpChannel(props, clientSinkProvider, serverSinkProvider);
			string name = chan.ChannelName;
			ChannelServices.RegisterChannel(chan, false);


			if (System.IO.File.Exists(configFile))
				RemotingConfiguration.Configure(configFile, false);
			else
				MessageBox.Show("Missing config file:\r\n" + configFile);

			RemotingConfiguration.RegisterWellKnownServiceType(
				typeof(Allberg.Shooter.WinShooterServer.ClientInterface),
				"WinShooterServer",
				WellKnownObjectMode.Singleton);
		}