public interface NetUtils
| 限定符和类型 | 接口和说明 |
|---|---|
static class |
NetUtils.StaticResolution |
| 限定符和类型 | 字段和说明 |
|---|---|
static org.slf4j.Logger |
LOG |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
address2String(InetSocketAddress address) |
static InetSocketAddress |
createLocalServerAddress()
Creates a unique local address.
|
static List<InetSocketAddress> |
createLocalServerAddress(int count)
Creates
count unique local addresses. |
static InetSocketAddress |
createSocketAddr(String target)
The same as createSocketAddr(target, -1).
|
static InetSocketAddress |
createSocketAddr(String target,
int defaultPort)
Create an InetSocketAddress from the given target and default port.
|
static InetSocketAddress |
createSocketAddrForHost(String host,
int port)
Create a socket address with the given host and port.
|
static InetSocketAddress createSocketAddr(String target)
static InetSocketAddress createSocketAddr(String target, int defaultPort)
target - a string of either "host", "host:port" or "scheme://host:port/path"defaultPort - the default port if target does not
include a port numberstatic InetSocketAddress createSocketAddrForHost(String host, int port)
NetUtils.StaticResolution.put(String, String).host - the hostname or IP use to instantiate the objectport - the port numberstatic List<InetSocketAddress> createLocalServerAddress(int count)
count unique local addresses. They may conflict with
addresses created later, but not with one another. Addresses are
guaranteed to be bound to the loopback interface.count - number of unique local addresses to createcount number of unique local addressesstatic InetSocketAddress createLocalServerAddress()
static String address2String(InetSocketAddress address)
Copyright © 2017–2021 The Apache Software Foundation. All rights reserved.