private void SetupChannel()
 {
     this._channelData = new ChannelDataStore(null);
     if (this._port > 0)
     {
         string channelUri = this.GetChannelUri();
         this._channelData.ChannelUris = new string[] { channelUri };
         this._wantsToListen           = false;
     }
     if (this._sinkProvider == null)
     {
         this._sinkProvider = this.CreateDefaultServerProviderChain();
     }
     CoreChannel.CollectChannelDataFromServerSinkProviders(this._channelData, this._sinkProvider);
     this._sinkChain          = ChannelServices.CreateServerChannelSinkChain(this._sinkProvider, this);
     this._transportSink      = new HttpServerTransportSink(this._sinkChain);
     base.SinksWithProperties = this._sinkChain;
     if (this._port >= 0)
     {
         this._tcpListener = new ExclusiveTcpListener(this._bindToAddr, this._port);
         ThreadStart start = new ThreadStart(this.Listen);
         this._listenerThread = new Thread(start);
         this._listenerThread.IsBackground = true;
         this.StartListening(null);
     }
 }
        private void SetupChannel()
        {
            if (this.authSet && !this._secure)
            {
                throw new RemotingException(CoreChannel.GetResourceString("Remoting_Tcp_AuthenticationConfigServer"));
            }
            this._channelData = new ChannelDataStore(null);
            if (this._port > 0)
            {
                this._channelData.ChannelUris = new string[] { this.GetChannelUri() };
            }
            if (this._sinkProvider == null)
            {
                this._sinkProvider = this.CreateDefaultServerProviderChain();
            }
            CoreChannel.CollectChannelDataFromServerSinkProviders(this._channelData, this._sinkProvider);
            IServerChannelSink nextSink = ChannelServices.CreateServerChannelSinkChain(this._sinkProvider, this);

            this._transportSink        = new TcpServerTransportSink(nextSink, this._impersonate);
            this._acceptSocketCallback = new AsyncCallback(this.AcceptSocketCallbackHelper);
            if (this._port >= 0)
            {
                this._tcpListener = new ExclusiveTcpListener(this._bindToAddr, this._port);
                this.StartListening(null);
            }
        }
Beispiel #3
0
        } // SetupMachineName

        private void SetupChannel()
        {
            // set channel data
            // (These get changed inside of StartListening(), in the case where the listen
            //   port is 0, because we can't determine the port number until after the
            //   TcpListener starts.)

            _channelData = new ChannelDataStore(null);
            if (_port > 0)
            {
                String channelUri = GetChannelUri();
                _channelData.ChannelUris    = new String[1];
                _channelData.ChannelUris[0] = channelUri;

                _wantsToListen = false;
            }

            // set default provider (soap formatter) if no provider has been set
            if (_sinkProvider == null)
            {
                _sinkProvider = CreateDefaultServerProviderChain();
            }

            CoreChannel.CollectChannelDataFromServerSinkProviders(_channelData, _sinkProvider);

            // construct sink chain
            _sinkChain     = ChannelServices.CreateServerChannelSinkChain(_sinkProvider, this);
            _transportSink = new HttpServerTransportSink(_sinkChain);

            // set sink properties on base class, so that properties will be chained.
            SinksWithProperties = _sinkChain;

            if (_port >= 0)
            {
                // Open a TCP port and create a thread to start listening
                _tcpListener = new ExclusiveTcpListener(_bindToAddr, _port);
                ThreadStart t = new ThreadStart(this.Listen);
                _listenerThread = new Thread(t);
                _listenerThread.IsBackground = true;

                // Wait for thread to spin up
                StartListening(null);
            }
        } // SetupChannel
        } // SetupMachineName

        private void SetupChannel()
        {
            // set channel data
            // (These get changed inside of StartListening(), in the case where the listen
            //   port is 0, because we can't determine the port number until after the
            //   TcpListener starts.)

            if (authSet && !_secure)
            {
                throw new RemotingException(CoreChannel.GetResourceString(
                                                "Remoting_Tcp_AuthenticationConfigServer"));
            }

            _channelData = new ChannelDataStore(null);
            if (_port > 0)
            {
                _channelData.ChannelUris    = new String[1];
                _channelData.ChannelUris[0] = GetChannelUri();
            }

            // set default provider (soap formatter) if no provider has been set
            if (_sinkProvider == null)
            {
                _sinkProvider = CreateDefaultServerProviderChain();
            }

            CoreChannel.CollectChannelDataFromServerSinkProviders(_channelData, _sinkProvider);

            // construct sink chain
            IServerChannelSink sink = ChannelServices.CreateServerChannelSinkChain(_sinkProvider, this);

            _transportSink = new TcpServerTransportSink(sink, _impersonate);
            // Initialize the accept socket callback
            _acceptSocketCallback = new AsyncCallback(AcceptSocketCallbackHelper);
            if (_port >= 0)
            {
                // Open a TCP port and create a thread to start listening
                _tcpListener = new ExclusiveTcpListener(_bindToAddr, _port);
                // Wait for thread to spin up
                StartListening(null);
            }
        } // SetupChannel