是否网卡上的地址

@param host 地址
@return 是否默认地址
963009
public static boolean isHostInNetworkCard(String host) {
        try {
            InetAddress addr = InetAddress.getByName(host);
            return NetworkInterface.getByInetAddress(addr) != null;
        } catch (Exception e) {
            return false;
        }
    }
1039417
public static function serializeHost($host)
    {
        if (is_int($host) || is_float($host)) {
            $string = self::serializeIPv4($host);
        } elseif (is_array($host)) {
            $string = '[' . self::serializeIPv6($host) . ']';
        } else {
            $string = (string)$host;
        }
        return $string;
    }
371467
public void setHost( String host )
    {
        _host = null;
        if ( host != null && host.length() > 0 )
        {
            //
            // Here's some very minimal support for IPv6 addresses.
            // If the literal IPv6 address is not enclosed in square brackets
            // then add them.
            //
            boolean needBrackets = ( ( host.indexOf( ':' ) >= 0 )
                    && !host.startsWith( "[" )
                    && !host.endsWith( "]" ) );

            if ( needBrackets )
            {
                _host = '[' + host + ']';
            }
            else
            {
                _host = host;
            }

            _opaque = false;
            setSchemeSpecificPart( null );
        }

        if ( _host == null )
        {
            setUserInfo( null );
            setPort( UNDEFINED_PORT );
        }
    }
1030876
public static Session getSession(String host, final String username,
                                     final String password) {
        // 设置配置文件，邮件主机和是否认证
        Properties property = new Properties();
        property.put("mail.host", host);
        property.put("mail.smtp.auth", "true");
        // 设置用户名和密码
        Authenticator auth = new Authenticator() {
            @Override
            protected PasswordAuthentication getPasswordAuthentication() {
                return new PasswordAuthentication(username, password);
            }
        };
        // 获取与邮件主机的连接
        Session session = Session.getInstance(property, auth);
        return session;
    }
129105
public function getHost(string $host)
	{
		$host = Host::filter($host);
		return $this->offsetExists($host) ? $this->hosts[$host] : null;
	}
408181
public static int count(final String host, final char charactor) {
    int count = 0;
    for (int i = 0; i < host.length(); i++) {
      if (host.charAt(i) == charactor) {
        count++;
      }
    }
    return count;
  }
189870
private String hostAndPort() {
        int start = url.indexOf("://") + 3;
        int end = url.indexOf("/", start);
        return url.substring(start, end);
    }
281461
public void setHost(String host) throws IllegalStateException {
        if (host == null) {
            throw new IllegalArgumentException("host parameter is null");
        }
        assertNotOpen();
        hostName = host;
    }
378889
public function host($host = '') {
        if ($host) {
            $this->host = $host;
        }
        if (!$this->host) {
            $this->host = self::server('HTTP_HOST');
        }
        return $this->host;
    }
74933
public java.lang.String getHost() {
    java.lang.Object ref = host_;
    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();
      if (bs.isValidUtf8()) {
        host_ = s;
      }
      return s;
    }
  }
539016
private static String getHost(final String endpoint) {
        String host = URI.create(endpoint).getHost();
        if (host == null) {
            host = URI.create("http://" + endpoint).getHost();
        }
        return host;
    }
788540
public CompanyDomain retrieveByHost(String host) {
		Criteria criteria = this.dao.newCriteria(CompanyDomain.class).add(Restrictions.eq("host", host));
		return (CompanyDomain) criteria.uniqueResult();
	}
75814
public final UdpServer host(String host) {
		Objects.requireNonNull(host, "host");
		return bootstrap(b -> b.localAddress(host, getPort(b)));
	}
1126681
public final B host(String host, int port) {
        requireNonNull(host, "host");
        checkArgument(!host.startsWith("group:"), "host: %s (must not start with 'group:')", host);
        checkArgument(port >= 1 && port < 65536, "port: %s (expected: 1 .. 65535)", port);

        final InetSocketAddress addr = newEndpoint(host, port);
        checkState(selectedProfile == null, "profile() and host() cannot be used together.");
        hosts = ImmutableSet.<InetSocketAddress>builder().addAll(hosts).add(addr).build();
        return self();
    }
1174373
public static InetAddress getIPHostAddress(String host) {
        InetAddress result = null;
        Matcher matcher = IPV4_QUADS.matcher(host);
        if (matcher == null || !matcher.matches()) {
            return result;
        }
        try {
            // Doing an Inet.getByAddress() avoids a lookup.
            result = InetAddress.getByAddress(host,
                    new byte[] {
                    (byte)(new Integer(matcher.group(1)).intValue()),
                    (byte)(new Integer(matcher.group(2)).intValue()),
                    (byte)(new Integer(matcher.group(3)).intValue()),
                    (byte)(new Integer(matcher.group(4)).intValue())});
        } catch (NumberFormatException e) {
            logger.warning(e.getMessage());
        } catch (UnknownHostException e) {
            logger.warning(e.getMessage());
        }
        return result;
    }
673025
@Override
    public final synchronized boolean addHost(Host host, boolean refresh) {
        // Already exists
        if (hosts.containsKey(host)) {
            // Check to see if we are adding token ranges or if the token ranges changed
            // which will force a rebuild of the token topology
            Host existingHost = hosts.get(host).getHost();
            if (existingHost.getTokenRanges().size() != host.getTokenRanges().size()) {
                existingHost.setTokenRanges(host.getTokenRanges());
                return true;
            }
            
            ArrayList<TokenRange> currentTokens = Lists.newArrayList(existingHost.getTokenRanges());
            ArrayList<TokenRange> newTokens     = Lists.newArrayList(host.getTokenRanges());
            Collections.sort(currentTokens, compareByStartToken);
            Collections.sort(newTokens,     compareByStartToken);
            for (int i = 0; i < currentTokens.size(); i++) {
                if (!currentTokens.get(i).getStartToken().equals(newTokens.get(i).getStartToken()) ||
                    !currentTokens.get(i).getEndToken().equals(newTokens.get(i).getEndToken())) {
                    return false;
                }
            }
            
            existingHost.setTokenRanges(host.getTokenRanges());
            return true;
        }
        else {
            HostConnectionPool<CL> pool = newHostConnectionPool(host, factory, config);
            if (null == hosts.putIfAbsent(host, pool)) {
                try {
                    monitor.onHostAdded(host, pool);
                    if (refresh) {
                        topology.addPool(pool);
                        rebuildPartitions();
                    }
                    pool.primeConnections(config.getInitConnsPerHost());
                }
                catch (Exception e) {
                    // Ignore, pool will have been marked down internally
                }
                return true;
            }
            else {
                return false;
            }
        }
    }
888305
public void setHost(String host) {
		if(isModifiable == ModifiableRule.ContactSystem || isModifiable == ModifiableRule.NotModifiable) {
			throw new IllegalArgumentException("Host part of the URI is not modifiable");
		}
		try {
			getSipURI().setHost(host);
		} catch (ParseException e) {
			logger.error("parse exception occured", e);
			throw new IllegalArgumentException("Bad arg!",e);
		}
	}