Exemple #1
0
        private IChannel RegisterChannel(bool server = false)
        {
            var props = new Dictionary <string, string>
            {
                { "name", GcChannelName },
                { "priority", Priority.ToString() }
            };

            if (server)
            {
                props["port"] = Port.ToString();
                if (!string.IsNullOrEmpty(ListenerInterface))
                {
                    props["interface"] = ListenerInterface;
                }
            }

            IChannel channel;

            switch (_channelType)
            {
            case GcChannelType.GHTTP: channel = new GenuineXHttpChannel(props, null, null);
                break;

            case GcChannelType.GTCP: channel = new GenuineTcpChannel(props, null, null);
                break;

            default: throw new NotImplementedException(_channelType.ToString());
            }

            ChannelServices.RegisterChannel(channel, false);
            return(channel);
        }
Exemple #2
0
        private static IChannel RegisterChannel(bool server = false)
        {
            var props = new Dictionary <string, string>
            {
                { "name", "GXHTTP" },
                { "priority", "100" }
            };

            if (server)
            {
                props["port"] = "8739";
            }

            var channel = new GenuineXHttpChannel(props, null, null);

            ChannelServices.RegisterChannel(channel, false);
            return(channel);
        }