예제 #1
0
        public static IChannel CreateServerChannel(ServerChannelDetails details)
        {
            var props = new Dictionary<string, string>();
            props["port"] = details.Port.ToString();
            var serverProvider = new BinaryServerFormatterSinkProvider();
            serverProvider.TypeFilterLevel = TypeFilterLevel.Full;

            switch (details.Mode)
            {
                case ChannelMode.NamedPipe:
                    return new IpcChannel(props, null, serverProvider);
                case ChannelMode.TCPIP:
                    return new TcpChannel(props, null, serverProvider);
                default:
                    return null;
            }
        }
예제 #2
0
 public void AddChannel(ServerChannelDetails details)
 {
     AddChannel(ChannelFactory.CreateServerChannel(details));
 }