Beispiel #1
0
        //setup HTTP client channel
        public void InitializeClientChannel(string name, bool enableSecurity)
        {
            RemotingUtils.RemoveChannel(name);

            var sinkProvider = new BinaryClientFormatterSinkProvider();

            var channel = new HttpClientChannel(name, sinkProvider);

            ChannelServices.RegisterChannel(channel, enableSecurity);
        }
Beispiel #2
0
        //setup HTTP server channel
        public void InitializeServerChannel(string name, int port, bool enableSecurity)
        {
            RemotingUtils.RemoveChannel(name);

            var sinkProvider = new BinaryServerFormatterSinkProvider();

            sinkProvider.TypeFilterLevel = TypeFilterLevel.Full;

            var channel = new System.Runtime.Remoting.Channels.Http.HttpServerChannel(name, port, sinkProvider);

            ChannelServices.RegisterChannel(channel, enableSecurity);
        }
Beispiel #3
0
        //setup TCP client channel
        public void InitializeClientChannel(string name, bool enableSecurity)
        {
            RemotingUtils.RemoveChannel(name);

            IDictionary channelSettings = new Hashtable();

            channelSettings["name"]   = name;
            channelSettings["secure"] = enableSecurity;

            var sinkProvider = new BinaryClientFormatterSinkProvider();

            IChannel channel = new TcpClientChannel(channelSettings, sinkProvider);

            ChannelServices.RegisterChannel(channel, enableSecurity);
        }
Beispiel #4
0
        //setup TCP server channel
        public void InitializeServerChannel(string name, int port, bool enableSecurity)
        {
            RemotingUtils.RemoveChannel(name);

            var sinkProvider = new BinaryServerFormatterSinkProvider();

            sinkProvider.TypeFilterLevel = TypeFilterLevel.Full;

            IDictionary channelSettings = new Hashtable();

            channelSettings["name"]   = name;
            channelSettings["port"]   = port;
            channelSettings["secure"] = enableSecurity;

            TcpServerChannel channel = new TcpServerChannel(channelSettings, sinkProvider);

            ChannelServices.RegisterChannel(channel, enableSecurity);
        }
Beispiel #5
0
        //setup ICP server channel
        public void InitializeIpcChannel(string name, string portName, bool enableSecurity)
        {
            RemotingUtils.RemoveChannel(name);

            IDictionary channelSettings = new Hashtable();

            channelSettings["name"]     = name;
            channelSettings["portName"] = portName;
            channelSettings["secure"]   = enableSecurity;

            var sinkProviderSrv = new BinaryServerFormatterSinkProvider();
            var sinkProviderClt = new BinaryClientFormatterSinkProvider();

            sinkProviderSrv.TypeFilterLevel = TypeFilterLevel.Full;

            IChannel channel = new IpcChannel(channelSettings, sinkProviderClt, sinkProviderSrv);

            ChannelServices.RegisterChannel(channel, enableSecurity);
        }
Beispiel #6
0
        //setup TCP channel
        public void InitializeChannel(string name, int port, bool enableSecurity)
        {
            RemotingUtils.RemoveChannel(name);

            var sinkProviderSrv = new BinaryServerFormatterSinkProvider();
            var sinkProviderClt = new BinaryClientFormatterSinkProvider();

            sinkProviderSrv.TypeFilterLevel = TypeFilterLevel.Full;

            IDictionary channelSettings = new Hashtable();

            channelSettings["name"]   = name;
            channelSettings["port"]   = port;
            channelSettings["secure"] = enableSecurity;

            IChannel channel = new TcpChannel(channelSettings, sinkProviderClt, sinkProviderSrv);

            LifetimeServices.LeaseTime = TimeSpan.FromDays(365000);
            ChannelServices.RegisterChannel(channel, enableSecurity);
        }