예제 #1
0
        /// <summary>
        /// Creates and configures a Remoting channel.
        /// </summary>
        /// <returns>Remoting channel</returns>
        public override IChannel CreateChannel()
        {
            IChannel channel = ChannelServices.GetChannel(_channelName);

            if (channel == null)
            {
                _channelSettings["name"]               = _channelName;
                _channelSettings["port"]               = _tcpPort;
                _channelSettings["bindTo"]             = _ipAddress;
                _channelSettings["socketCacheTimeout"] = 0;
                _channelSettings["socketCachePolicy"]  = SocketCachingEnabled ? SocketCachePolicy.Default : SocketCachePolicy.AbsoluteTimeout;
                _channelSettings["secure"]             = false;

                ConfigureEncryption();
                ConfigureCompression();

                if (_channelFactory == null)
                {
                    throw new ApplicationException(LanguageResource.ApplicationException_NoChannelFactorySpecified);
                }

                channel = _channelFactory(_channelSettings, BuildClientSinkChain(), BuildServerSinkChain());
                RemotingHelper.ResetCustomErrorsMode();
            }

            return(channel);
        }
예제 #2
0
        /// <summary>
        /// Creates and configures a Remoting channel.
        /// </summary>
        /// <returns>Remoting channel</returns>
        public override IChannel CreateChannel()
        {
            IChannel channel = ChannelServices.GetChannel(_channelName);

            if (channel == null)
            {
                _channelSettings["name"]               = _channelName;
                _channelSettings["port"]               = _tcpPort;
                _channelSettings["bindTo"]             = _ipAddress;
                _channelSettings["secure"]             = _useWindowsSecurity;
                _channelSettings["socketCacheTimeout"] = 0;
                _channelSettings["socketCachePolicy"]  = SocketCachingEnabled ? SocketCachePolicy.Default : SocketCachePolicy.AbsoluteTimeout;

                if (_useWindowsSecurity)
                {
                    _channelSettings["tokenImpersonationLevel"] = _impersonationLevel;
                    _channelSettings["protectionLevel"]         = _protectionLevel;
                }
                if (_channelFactory == null)
                {
                    throw new ApplicationException(LanguageResource.ApplicationException_NoChannelFactorySpecified);
                }

                channel = _channelFactory(_channelSettings, BuildClientSinkChain(), BuildServerSinkChain());
                RemotingHelper.ResetCustomErrorsMode();
            }

            return(channel);
        }
예제 #3
0
        /// <summary>
        /// Creates and configures a Remoting channel.
        /// </summary>
        /// <returns>Remoting channel</returns>
        public override IChannel CreateChannel()
        {
            IChannel channel = ChannelServices.GetChannel(_channelName);

            if (channel == null)
            {
                _channelSettings["name"]              = _channelName;
                _channelSettings["port"]              = _tcpPort;
                _channelSettings["bindTo"]            = _ipAddress;
                _channelSettings["listen"]            = true;
                _channelSettings["typeFilterLevel"]   = TypeFilterLevel.Full;
                _channelSettings["keepAliveEnabled"]  = _tcpKeepAliveEnabled;
                _channelSettings["keepAliveTime"]     = _tcpKeepAliveTime;
                _channelSettings["keepAliveInterval"] = _tcpKeepAliveInterval;

                ConfigureEncryption();
                ConfigureCompression();

                if (_channelFactory == null)
                {
                    throw new ApplicationException(LanguageResource.ApplicationException_NoChannelFactorySpecified);
                }

                channel = _channelFactory(_channelSettings, BuildClientSinkChain(), BuildServerSinkChain());
                RemotingHelper.ResetCustomErrorsMode();
            }

            return(channel);
        }
예제 #4
0
        /// <summary>
        /// Creates and configures a Remoting channel.
        /// </summary>
        /// <returns>Remoting channel</returns>
        public virtual IChannel CreateChannel()
        {
            IChannel channel = ChannelServices.GetChannel(_channelName);

            if (channel == null)
            {
                if (_channelFactory == null)
                {
                    throw new ApplicationException(LanguageResource.ApplicationException_NoChannelFactorySpecified);
                }

                _channelSettings["name"] = _channelName;
                channel = _channelFactory(_channelSettings, BuildClientSinkChain(), BuildServerSinkChain());

                RemotingHelper.ResetCustomErrorsMode();
                return(channel);
            }
            return(channel);
        }
예제 #5
0
        /// <summary>
        /// Creates and configures a Remoting channel.
        /// </summary>
        /// <returns>Remoting channel</returns>
        public override IChannel CreateChannel()
        {
            IChannel channel = ChannelServices.GetChannel(_channelName);

            if (channel == null)
            {
                _channelSettings["name"] = _channelName;
                _channelSettings["port"] = 0;

                ConfigureEncryption();
                ConfigureCompression();

                if (_channelFactory == null)
                {
                    throw new ApplicationException(LanguageResource.ApplicationException_NoChannelFactorySpecified);
                }

                channel = _channelFactory(_channelSettings, BuildClientSinkChain(), BuildServerSinkChain());
                RemotingHelper.ResetCustomErrorsMode();
            }

            return(channel);
        }
예제 #6
0
        /// <summary>
        /// Creates and configures a Remoting channel.
        /// </summary>
        /// <returns>Remoting channel</returns>
        public override IChannel CreateChannel()
        {
            var channel = ChannelServices.GetChannel(_channelName);

            if (channel == null)
            {
                _channelSettings["name"]     = _channelName;
                _channelSettings["portName"] = "zyan_" + Guid.NewGuid().ToString();
                if (!_channelSettings.ContainsKey("authorizedGroup"))
                {
                    _channelSettings["authorizedGroup"] = AuthorizedGroup;
                }

                if (!_channelSettings.ContainsKey("exclusiveAddressUse"))
                {
                    _channelSettings["exclusiveAddressUse"] = ExclusiveAddressUse;
                }

                _channelSettings["secure"] = _useWindowsSecurity;
                if (_useWindowsSecurity)
                {
                    _channelSettings["tokenImpersonationLevel"] = _impersonationLevel;
                    _channelSettings["protectionLevel"]         = _protectionLevel;
                }

                if (_channelFactory == null)
                {
                    throw new ApplicationException(LanguageResource.ApplicationException_NoChannelFactorySpecified);
                }

                channel = _channelFactory(_channelSettings, BuildClientSinkChain(), BuildServerSinkChain());
                RemotingHelper.ResetCustomErrorsMode();
            }

            return(channel);
        }