Class AddressUtils
- java.lang.Object
-
- io.servicetalk.transport.netty.internal.AddressUtils
-
public final class AddressUtils extends java.lang.ObjectA utility class to work with addresses.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringhostHeader(HostAndPort hostAndPort)Returns a {code HOST} header value based of the information inHostAndPort.static java.net.InetSocketAddresslocalAddress(int port)Creates anInetSocketAddresswithloopback addressand specified port number.static DomainSocketAddressnewSocketAddress()Creates a newDomainSocketAddress.static HostAndPortserverHostAndPort(ServerContext ctx)Returns aHostAndPortrepresentation of server's listening address.
-
-
-
Method Detail
-
localAddress
public static java.net.InetSocketAddress localAddress(int port)
Creates anInetSocketAddresswithloopback addressand specified port number.- Parameters:
port- the port number- Returns:
- an
InetSocketAddresswithloopback addressand specified port number
-
serverHostAndPort
public static HostAndPort serverHostAndPort(ServerContext ctx)
Returns aHostAndPortrepresentation of server's listening address.- Parameters:
ctx- TheServerContextof the server- Returns:
- a
HostAndPortrepresentation 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 theHOSTheader- Returns:
- a
HOSTheader 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
-
-