public final class AddressUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
hostHeader(HostAndPort hostAndPort)
Returns a {code HOST} header value based of the information in
HostAndPort . |
static java.net.InetSocketAddress |
localAddress(int port)
Creates an
InetSocketAddress with loopback address and specified
port number. |
static DomainSocketAddress |
newSocketAddress()
Creates a new
DomainSocketAddress . |
static HostAndPort |
serverHostAndPort(ServerContext ctx)
Returns a
HostAndPort representation of server's listening address. |
public static java.net.InetSocketAddress localAddress(int port)
InetSocketAddress
with loopback address
and specified
port number.port
- the port numberInetSocketAddress
with loopback address
and specified
port numberpublic static HostAndPort serverHostAndPort(ServerContext ctx)
HostAndPort
representation of server's listening address.ctx
- The ServerContext
of the serverHostAndPort
representation of server's listening address.public static java.lang.String hostHeader(HostAndPort hostAndPort)
HostAndPort
.hostAndPort
- to convert to the HOST
headerHOST
header valuepublic static DomainSocketAddress newSocketAddress() throws java.io.IOException
DomainSocketAddress
.DomainSocketAddress
java.io.IOException
- if a temporary file cannot be created for DomainSocketAddress