예제 #1
0
        } // HttpServerChannel

        private void SetupMachineName()
        {
            if (_forcedMachineName != null)
            {
                // an explicitly configured machine name was used
                _machineName = CoreChannel.DecodeMachineName(_forcedMachineName);
            }
            else
            {
                if (!_bUseIpAddress)
                {
                    _machineName = CoreChannel.GetMachineName();
                }
                else
                {
                    if (_bindToAddr == IPAddress.Any)
                    {
                        _machineName = CoreChannel.GetMachineIp();
                    }
                    else
                    {
                        _machineName = _bindToAddr.ToString();
                    }
                }
            }
        } // SetupMachineName
 private void SetupMachineName()
 {
     if (this._forcedMachineName != null)
     {
         this._machineName = CoreChannel.DecodeMachineName(this._forcedMachineName);
     }
     else if (!this._bUseIpAddress)
     {
         this._machineName = CoreChannel.GetMachineName();
     }
     else
     {
         if ((this._bindToAddr == IPAddress.Any) || (this._bindToAddr == IPAddress.IPv6Any))
         {
             this._machineName = CoreChannel.GetMachineIp();
         }
         else
         {
             this._machineName = this._bindToAddr.ToString();
         }
         if (this._bindToAddr.AddressFamily == AddressFamily.InterNetworkV6)
         {
             this._machineName = "[" + this._machineName + "]";
         }
     }
 }
        private void SetupMachineName()
        {
            if (_forcedMachineName != null)
            {
                // an explicitly configured machine name was used
                _machineName = CoreChannel.DecodeMachineName(_forcedMachineName);
            }
            else
            {
                if (!_bUseIpAddress)
                {
                    _machineName = CoreChannel.GetMachineName();
                }
                else
                {
                    if (_bindToAddr == IPAddress.Any || _bindToAddr == IPAddress.IPv6Any)
                    {
                        _machineName = CoreChannel.GetMachineIp();
                    }
                    else
                    {
                        _machineName = _bindToAddr.ToString();
                    }

                    // Add [] around the ipadress for IPv6
                    if (_bindToAddr.AddressFamily == AddressFamily.InterNetworkV6)
                    {
                        _machineName = "[" + _machineName + "]";
                    }
                }
            }
        } // SetupMachineName