Retrieves the address of the remote address to connect to.
@see TCPConnectRequestContext#getRemoteAddress()
337533
public InetSocketAddress getRemoteAddress()
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getRemoteAddress");
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getRemoteAddress","rc="+remoteAddress);
      return remoteAddress;
   }
371704
public static function getIPAddress()
    {
        if (isset($_SERVER['HTTP_CLIENT_IP'])) {
            return $_SERVER['HTTP_CLIENT_IP'];
        } elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
            ///to check ip is pass from proxy
            return $_SERVER['HTTP_X_FORWARDED_FOR'];
        } elseif (isset($_SERVER['REMOTE_ADDR'])) {
            return $_SERVER['REMOTE_ADDR'];
        }

        return null;
    }
992377
public function getRemoteAddress()
    {
        if (($sValue = $this->getViewConfigParam('ip')) === null) {
            $sValue = \OxidEsales\Eshop\Core\Registry::getUtilsServer()->getRemoteAddress();
            $this->setViewConfigParam('ip', $sValue);
        }

        return $sValue;
    }
1025947
public SockAddr getAddr() {
		SockAddr sockAddr = null;
		if (this.addr != null) {
			sockAddr = new SockAddr(this.addr.getSaFamily().getValue(), this.addr.getData());
		}
		return sockAddr;
	}
905989
@Override
    public int getRemotePort() {
        int port = this.connection.getRemotePort();
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "getRemotePort: " + port);
        }
        return port;
    }
92989
@Override
    public Address getAddress(final double longitude, final double latitude) throws IOException {

        final NominatimReverseRequest q = new NominatimReverseRequest();
        q.setQuery(longitude, latitude);
        return this.getAddress(q);
    }
1876
public Socket get(SocketAddress remote) {
    synchronized(multimap) {
      List<Socket> sockList = multimap.get(remote);
      if (sockList == null) {
        return null;
      }
      
      Iterator<Socket> iter = sockList.iterator();
      while (iter.hasNext()) {
        Socket candidate = iter.next();
        iter.remove();
        if (!candidate.isClosed()) {
          return candidate;
        }
      }
    }
    return null;
  }
958959
public RemoteAddress getAddress(String nodeID) {
		NodeDescriptor node = nodes.get(nodeID);
		if (node == null) {
			return null;
		}
		RemoteAddress address;
		node.readLock.lock();
		try {
			address = new RemoteAddress(node.host, node.port);
		} finally {
			node.readLock.unlock();
		}
		return address;
	}
167540
public function getClientAddress()
    {
        $address = null;
        if ($this->getHeaderLine('X_FORWARDED_FOR') && $this->trustProxy) {
            $address = $this->getHeaderLine('X_FORWARDED_FOR');
        }

        if (is_null($address) && $this->getServer('REMOTE_ADDR')) {
            $address = $this->getServer('REMOTE_ADDR');
        }

        if ($address) {
            $addresses = explode(',', $address);
            return $addresses[0];
        }

        return '';
    }
573994
public static InetAddress getLocalIPAddress() {
        Enumeration<NetworkInterface> enumeration = null;
        try {
            enumeration = NetworkInterface.getNetworkInterfaces();
        } catch (SocketException e) {
            e.printStackTrace();
        }
        if (enumeration != null) {
            while (enumeration.hasMoreElements()) {
                NetworkInterface nif = enumeration.nextElement();
                Enumeration<InetAddress> inetAddresses = nif.getInetAddresses();
                if (inetAddresses != null) {
                    while (inetAddresses.hasMoreElements()) {
                        InetAddress inetAddress = inetAddresses.nextElement();
                        if (!inetAddress.isLoopbackAddress() && isIPv4Address(inetAddress.getHostAddress())) {
                            return inetAddress;
                        }
                    }
                }
            }
        }
        return null;
    }
568310
public InetAddress getInetAddress ()
    {
        Connection conn = getConnection();
        return (conn == null) ? null : conn.getInetAddress();
    }
1187713
public SockAddr getDstAddr() {
		SockAddr sockAddr = null;
		if (this.dstaddr != null) {
			sockAddr = new SockAddr(this.dstaddr.getSaFamily().getValue(), this.dstaddr.getData());
		}
		return sockAddr;
	}
899050
static InetSocketAddress getRemoteNamenodeAddress(Configuration conf, 
      InstanceId instance) 
    throws IOException {
    String fs = null;
    if (instance == InstanceId.NODEZERO) {
      fs = conf.get(DFS_NAMENODE_RPC_ADDRESS1_KEY);
      if (fs == null)
        fs = conf.get("fs.default.name1");
    } else if (instance == InstanceId.NODEONE) {
      fs = conf.get(DFS_NAMENODE_RPC_ADDRESS0_KEY);
      if (fs == null)
        fs = conf.get("fs.default.name0");
    } else {
      throw new IOException("Unknown instance " + instance);
    }
    if(fs != null) {
      Configuration newConf = new Configuration(conf);
      newConf.set(FSConstants.DFS_NAMENODE_RPC_ADDRESS_KEY, fs);
      conf = newConf;
    }
    return NameNode.getClientProtocolAddress(conf);
  }
945840
protected String getRemoteAddress(ContainerRequestContext request) {
        String ip = null;
        if (realIpHeader != null && realIpHeader.length() != 0) {
            ip = request.getHeaderString(realIpHeader);
        }
        if (StringUtils.isBlank(ip)) {
            ip = request.getHeaderString("x-forwarded-for");
            if (StringUtils.isBlank(ip) || "unknown".equalsIgnoreCase(ip)) {
                ip = request.getHeaderString("Proxy-Client-IP");
            }
            if (StringUtils.isBlank(ip) || "unknown".equalsIgnoreCase(ip)) {
                ip = request.getHeaderString("WL-Proxy-Client-IP");
            }
            if (StringUtils.isBlank(ip) || "unknown".equalsIgnoreCase(ip)) {
                ip = "unknown";
            }
        }
        return ip;
    }
834471
@Override
    public String getRemoteUser() {
        String user = getHeader("X_REMOTE_USER");
        if (user != null) {
            return user;
        } else {
            return super.getRemoteUser();
        }
    }
893988
private static InetAddress getLocalHostBySocket(InetSocketAddress remoteAddress) {
        InetAddress host = null;
        try {
            // 去连一下远程地址
            Socket socket = new Socket();
            try {
                socket.connect(remoteAddress, 1000);
                // 得到本地地址
                host = socket.getLocalAddress();
            } finally {
                IOUtils.closeQuietly(socket);
            }
        } catch (Exception e) {
            LOGGER.warn("Can not connect to host {}, cause by :{}",
                remoteAddress.toString(), e.getMessage());
        }
        return host;
    }
1226898
@Override
  public int getRemoteAddress(byte []buffer, int offset, int length)
  {
    int len = _remoteAddrLength;

    if (len <= 0) {
      len = _remoteAddrLength = InetAddressUtil.createIpAddress(_remoteAddrBuffer,
                                                                _remoteAddrCharBuffer);
    }

    char []charBuffer = _remoteAddrCharBuffer;

    for (int i = len - 1; i >= 0; i--) {
      buffer[offset + i] = (byte) charBuffer[i];
    }

    return len;
  }