This method returns the address of the machine. It is needed to successfully communicate
with emulators hosted into other machines.
@return
435487
public static InetAddress getAddress() {
    	
        try {
        	return InetAddress.getByAddress(new byte[] {0,0,0,0});
            /*for (Enumeration e = NetworkInterface.getNetworkInterfaces();
                    e.hasMoreElements();) {

                NetworkInterface ni = (NetworkInterface) e.nextElement();
                System.out.println("NetworkInterface = " + ni.getName());
                if (!ni.getName().contains("lo")) {
                    for (Enumeration ee = ni.getInetAddresses(); ee.hasMoreElements();) {
                        InetAddress ip = (InetAddress) ee.nextElement();
                        if (ip instanceof Inet4Address && ip.getAddress() != null) {
                            return ip;
                        }
                        //System.out.println("Ip's: " + ip.getHostAddress());
                    }
                }
            }
            NetworkInterface lo = NetworkInterface.getByName("lo");
            if (lo != null) {
                for (Enumeration ee = lo.getInetAddresses(); ee.hasMoreElements();) {
                    InetAddress ip = (InetAddress) ee.nextElement();
                    if (ip instanceof Inet4Address && ip.getAddress() != null) {
                        return ip;
                    }
                }
            }
            
            NetworkInterface lo0 = NetworkInterface.getByName("lo0");
            if (lo0 != null) {
                for (Enumeration ee = lo0.getInetAddresses(); ee.hasMoreElements();) {
                    InetAddress ip = (InetAddress) ee.nextElement();
                    if (ip instanceof Inet4Address && ip.getAddress() != null) {
                        return ip;
                    }
                }
            }*/
        } catch (Exception e) {
            System.err.println("Error");
        }
        return null;
    }
1277383
protected final InetSocketAddress localAddress() {
        if (localAddress == null) {
            if (server) {
                localAddress = new InetSocketAddress(NetUtil.LOCALHOST,
                                                     guessServerPort(sessionProtocol, authority));
            } else {
                localAddress = new InetSocketAddress(NetUtil.LOCALHOST, randomClientPort());
            }
        }
        return localAddress;
    }
1280439
public String getRemoteAddr() {
        if (remoteAddrHeader != null) {
            String val = getHeader(remoteAddrHeader);
            if (val != null) return val;
        }
        SocketAddress addr = getRemoteAddress();
        if (addr == null) return "";
        if (addr instanceof InetSocketAddress) return ((InetSocketAddress) addr).getAddress().getHostAddress();
        return String.valueOf(addr);
    }
1270817
public String getRemoteAddr()
    {
        if (_remoteAddr==null)
        {
            if (_remoteInetAddress==null)
                return "127.0.0.1";
            _remoteAddr=_remoteInetAddress.getHostAddress();
        }
        return _remoteAddr;
    }
73683
public static InetAddress getLocalHost() throws UnknownHostException {
        InetAddress addr;
        try {
            addr = InetAddress.getLocalHost();
        } catch (ArrayIndexOutOfBoundsException e) {  //this is workaround for mac osx bug see AS7-3223 and JGRP-1404
            addr = InetAddress.getByName(null);
        }
        return addr;
    }
253255
public InetSocketAddress getNextDirectoryServer(){

        index = index + 1;
        if(index == servers.size()){
            index = 0;
        }
        InetSocketAddress unresolved = servers.get(index);

//        List<InetSocketAddress> resolved = null;
//        try {
//            InetAddress[] addresses = InetAddress.getAllByName(unresolved.getHostName());
//            for(InetAddress address : addresses){
//                if(resolved == null){
//                    resolved = new ArrayList<InetSocketAddress>();
//                }
//                resolved.add(new InetSocketAddress(address.getHostAddress(), unresolved.getPort()));
//            }
//        } catch (UnknownHostException e) {
//            LOGGER.error("Resolve the Directory Server failed, host=" + unresolved.getAddress().toString() + " - " + e.getMessage());
//        }
//
//        if(resolved == null){
//            return Collections.emptyList();
//        }
        return new InetSocketAddress(unresolved.getHostName(), unresolved.getPort());
    }
358658
public alluxio.grpc.WorkerNetAddress getWorkerAddress() {
    return workerAddress_ == null ? alluxio.grpc.WorkerNetAddress.getDefaultInstance() : workerAddress_;
  }
176872
public InetAddress getInetAddress() throws UnknownHostException{
     if(ip!=null) return ip;

     return (ip=InetAddress.getByName(host));
   }
504408
public String getHost()
    {
        if (_addr==null)
            return __0_0_0_0;
        
        return _addrIsHost?_addr.getHostName():_addr.getHostAddress();
    }
1025947
public SockAddr getAddr() {
		SockAddr sockAddr = null;
		if (this.addr != null) {
			sockAddr = new SockAddr(this.addr.getSaFamily().getValue(), this.addr.getData());
		}
		return sockAddr;
	}
1302696
@Override
  public InetAddress addressLocal()
  {
    Socket s = getSocket();
    
    if (s != null) {
      return s.getLocalAddress();
    }
    else {
      return null;
    }
  }
1114657
def address_for(machine)
      with_pool_for(machine, read_only=true) do |pool|
        pool.address_for(machine)
      end
    end
568310
public InetAddress getInetAddress ()
    {
        Connection conn = getConnection();
        return (conn == null) ? null : conn.getInetAddress();
    }
780547
@Override
	public String retrievePublicIpAddress( TargetHandlerParameters parameters, String machineId )
	throws TargetException {

		String result = null;
		try {
			ServiceInstance vmwareServiceInstance = VmwareIaasHandler.getServiceInstance( parameters.getTargetProperties());
			String rootInstanceName = InstanceHelpers.findRootInstancePath( parameters.getScopedInstancePath());
			VirtualMachine vm = VmwareIaasHandler.getVirtualMachine( vmwareServiceInstance, rootInstanceName );
			if( vm != null )
				result = vm.getGuest().getIpAddress();

		} catch( Exception e ) {
			throw new TargetException( e );
		}

		return result;
	}
637634
protected String getRemoteAddress() {
        String ipAddress = this.response.getRequest().getHeader("x-forwarded-for");
        if (ipAddress == null) {
            ipAddress = this.response.getRequest().getHeader("X_FORWARDED_FOR");
            if (ipAddress == null){
                ipAddress = this.response.getRequest().getRemoteAddr();
            }
        }
        return this.response.getRequest().getScheme() + "://" + ipAddress;
    }
1057494
public Address getLocalParty() {
		if(sessionCreatingDialog != null) {
			return new AddressImpl(sessionCreatingDialog.getLocalParty(), null, ModifiableRule.NotModifiable);
		} else if (sessionCreatingTransactionRequest != null){
			if(isSessionCreatingTransactionServer) {
				ToHeader toHeader = (ToHeader) sessionCreatingTransactionRequest.getMessage().getHeader(ToHeader.NAME);
				return new AddressImpl(toHeader.getAddress(), AddressImpl.getParameters((Parameters)toHeader),  ModifiableRule.NotModifiable);
			} else {
				FromHeader fromHeader = (FromHeader)sessionCreatingTransactionRequest.getMessage().getHeader(FromHeader.NAME);
				return new AddressImpl(fromHeader.getAddress(), AddressImpl.getParameters((Parameters)fromHeader),  ModifiableRule.NotModifiable);
			}
		} else {
			return localParty;
		}
	}
290650
Address getLocalAddress()
   {
      if (localAddress == null)
         localAddress = new Address(getId(), getName(), transport != null ? transport.getId() : null);

      return localAddress;
   }