Returns a Vector of SocketDetail representing the IP/Domain name
of the currently connected sockets that this receiver has
been responsible for creating.
@return Vector of SocketDetails
508169
public Vector getConnectedSocketDetails() {
    Vector details = new Vector(socketList.size());

    for (Enumeration enumeration = socketList.elements();
         enumeration.hasMoreElements();
            ) {
      Socket socket = (Socket) enumeration.nextElement();
      details.add(
        new SocketDetail(socket, (SocketNode13) socketMap.get(socket)));
    }

    return details;
  }
468078
public IPv4Address getEmbeddedIPv4Address() {
		IPv4AddressCreator creator = getIPv4Network().getAddressCreator();
		return creator.createAddress(getSection().getEmbeddedIPv4AddressSection()); /* address creation */
	}
213379
public static String[] getByInternalAPI() {
        try {
            Class<?> resolverConfiguration =
                    Class.forName("sun.net.dns.ResolverConfiguration");
            Method open = resolverConfiguration.getMethod("open");
            Method getNameservers = resolverConfiguration.getMethod("nameservers");
            Object instance = open.invoke(null);
            List nameservers = (List) getNameservers.invoke(instance);
            if (nameservers == null || nameservers.size() == 0) {
                return null;
            }
            String[] ret = new String[nameservers.size()];
            int i = 0;
            for (Object dns : nameservers) {
                ret[i++] = (String) dns;
            }
            return ret;
        } catch (Exception e) {
            // we might trigger some problems this way
            e.printStackTrace();
        }
        return null;
    }
1187713
public SockAddr getDstAddr() {
		SockAddr sockAddr = null;
		if (this.dstaddr != null) {
			sockAddr = new SockAddr(this.dstaddr.getSaFamily().getValue(), this.dstaddr.getData());
		}
		return sockAddr;
	}
259510
static public String getExternalIpAddress(){
		String ip = null;
		URL url = null;
		BufferedReader in = null;
		
		for (int i = 0; !isIPv4Address(ip) && i < CHECK_IP_ENDPOINTS.length; i ++, url = null, in = null){
			try{
				url = new URL(CHECK_IP_ENDPOINTS[i]);
				in = new BufferedReader(new InputStreamReader(url.openStream()));
				ip = in.readLine(); //you get the IP as a String
			}catch(Exception e){
				System.err.println("Unable to find out external IP address through end point '" + CHECK_IP_ENDPOINTS[i] + "': " + e.getMessage());
				if (in != null){
					try{
						in.close();
					}catch(Exception e2){
						// ignore
					}
				}
			}
		}
		return ip;
		
	}
1362577
public String getHostAddress() {
        if( addr instanceof NbtAddress ) {
            return ((NbtAddress)addr).getHostAddress();
        }
        return ((InetAddress)addr).getHostAddress();
    }
85250
public static long getServerId() {
		String ipAddress = getLocalHostAddress();
		try {
			long result = 0;
			String[] array = ipAddress.split("\\.");
			for(String s : array){
				long i = Long.parseLong(s);
				result = 256 * result + i;
			}
			return result;
		} catch (Exception e) {
			return ipAddress.hashCode();
		}
	}
1243799
def first_ipv4(self) -> Optional[AddressInfo]:
        ''''''
        for info in self._address_infos:
            if info.family == socket.AF_INET:
                return info
237351
public java.lang.String getServerIp() {
    java.lang.Object ref = serverIp_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      serverIp_ = s;
      return s;
    }
  }
1105638
public java.util.List<NatGatewayAddress> getNatGatewayAddresses() {
        if (natGatewayAddresses == null) {
            natGatewayAddresses = new com.amazonaws.internal.SdkInternalList<NatGatewayAddress>();
        }
        return natGatewayAddresses;
    }
1291847
public String serverName() {
        if (tc.isDebugEnabled())
            Tr.debug(tc, "serverName", new Object[] { this, _serverName });
        return _serverName;
    }
126519
public String firstCalledName() {

        calledName = hostName.name;

        if( Character.isDigit( calledName.charAt( 0 ))) {
            int i, len, dots;
            char[] data;

            i = dots = 0;                    /* quick IP address validation */
            len = calledName.length();
            data = calledName.toCharArray();
            while( i < len && Character.isDigit( data[i++] )) {
                if( i == len && dots == 3 ) {
                    // probably an IP address
                    calledName = SMBSERVER_NAME;
                    break;
                }
                if( i < len && data[i] == '.' ) {
                    dots++;
                    i++;
                }
            }
        } else {
            switch (hostName.hexCode) {
                case 0x1B:
                case 0x1C:
                case 0x1D:
                    calledName = SMBSERVER_NAME;
            }
        }

        return calledName;
    }
855842
def get_interface_addresses():
    

    addresses = []
    ifaces = netifaces.interfaces()
    for iface in ifaces:
        addrs = netifaces.ifaddresses(iface)
        families = addrs.keys()

        # put IPv4 to the end so it lists as the main iface address
        if netifaces.AF_INET in families:
            families.remove(netifaces.AF_INET)
            families.append(netifaces.AF_INET)

        for family in families:
            for addr in addrs[family]:
                address = {
                    'name': iface,
                    'family': family,
                    'ip': addr['addr'],
                }
                addresses.append(address)

    return addresses
1172373
public static Collection<InetAddress> getNetworkInterfaces()
            throws SocketException {
        final Collection<InetAddress> addresses = new ArrayList<InetAddress>();
        final Enumeration<NetworkInterface> e = 
            NetworkInterface.getNetworkInterfaces();
        while (e.hasMoreElements()) {
            final NetworkInterface ni = e.nextElement();
            final Enumeration<InetAddress> niAddresses = ni.getInetAddresses();
            while (niAddresses.hasMoreElements()) {
                addresses.add(niAddresses.nextElement());
            }
        }
        return addresses;
    }
454188
public java.util.List<String> getAssignedIpv6Addresses() {
        if (assignedIpv6Addresses == null) {
            assignedIpv6Addresses = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return assignedIpv6Addresses;
    }
71527
public function getBroadcastAddress()
    {
        $network_quads         = $this->getNetworkPortionQuads();
        $number_ip_addresses   = $this->getNumberIPAddresses();

        $network_range_quads   = [];
        $network_range_quads[] = sprintf(self::FORMAT_QUADS, ( $network_quads[0] & ( $this->subnet_mask >> 24 ) ) + ( ( ( $number_ip_addresses - 1 ) >> 24 ) & 0xFF ));
        $network_range_quads[] = sprintf(self::FORMAT_QUADS, ( $network_quads[1] & ( $this->subnet_mask >> 16 ) ) + ( ( ( $number_ip_addresses - 1 ) >> 16 ) & 0xFF ));
        $network_range_quads[] = sprintf(self::FORMAT_QUADS, ( $network_quads[2] & ( $this->subnet_mask >>  8 ) ) + ( ( ( $number_ip_addresses - 1 ) >>  8 ) & 0xFF ));
        $network_range_quads[] = sprintf(self::FORMAT_QUADS, ( $network_quads[3] & ( $this->subnet_mask >>  0 ) ) + ( ( ( $number_ip_addresses - 1 ) >>  0 ) & 0xFF ));

        return implode('.', $network_range_quads);
    }
293493
function getBroadcastAddresses() {
    // enumerate interfaces
    var net = os.networkInterfaces();
    var broadcastAddresses = Object.keys(net)
        // flatten the array structure
        .map(function (k) { return net[k]; })
        .reduce(function (prev, cur) { return prev.concat.apply(prev, cur); }, [])
        // only use external IPv4 ones
        .filter(function (add) { return !add.internal && add.family === "IPv4"; })
        // extract address and subnet as number array
        .map(function (k) { return ({
        address: k.address.split(".").map(function (num) { return +num; }),
        netmask: k.netmask.split(".").map(function (num) { return +num; }),
    }); })
        // broadcast is address OR (not netmask)
        .map(function (add) {
        return add.address.map(function (val, i) { return (val | ~add.netmask[i]) & 0xff; });
    })
        // ignore unconnected ones
        .filter(function (add) { return add[0] !== 169; })
        // turn the address into a string again
        .map(function (a) { return a[0] + "." + a[1] + "." + a[2] + "." + a[3]; });
    return broadcastAddresses;
}