//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); }
//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); }
//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); }
//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); }
//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); }
//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); }