Class AddressUtils
- java.lang.Object
-
- io.servicetalk.transport.netty.internal.AddressUtils
-
public final class AddressUtils extends java.lang.Object
A utility class to work with addresses.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
hostHeader(HostAndPort hostAndPort)
Returns a {code HOST} header value based of the information inHostAndPort
.static java.net.InetSocketAddress
localAddress(int port)
Creates anInetSocketAddress
withloopback address
and specified port number.static DomainSocketAddress
newSocketAddress()
Creates a newDomainSocketAddress
.static HostAndPort
serverHostAndPort(ServerContext ctx)
Returns aHostAndPort
representation of server's listening address.
-
-
-
Method Detail
-
localAddress
public static java.net.InetSocketAddress localAddress(int port)
Creates anInetSocketAddress
withloopback address
and specified port number.- Parameters:
port
- the port number- Returns:
- an
InetSocketAddress
withloopback address
and specified port number
-
serverHostAndPort
public static HostAndPort serverHostAndPort(ServerContext ctx)
Returns aHostAndPort
representation of server's listening address.- Parameters:
ctx
- TheServerContext
of the server- Returns:
- a
HostAndPort
representation of server's listening address.
-
hostHeader
public static java.lang.String hostHeader(HostAndPort hostAndPort)
Returns a {code HOST} header value based of the information inHostAndPort
.- Parameters:
hostAndPort
- to convert to theHOST
header- Returns:
- a
HOST
header value
-
newSocketAddress
public static DomainSocketAddress newSocketAddress() throws java.io.IOException
Creates a newDomainSocketAddress
.- Returns:
- a new
DomainSocketAddress
- Throws:
java.io.IOException
- if a temporary file cannot be created forDomainSocketAddress
-
-