Top Description Methods
io.vertx.core.net

public Interface SocketAddress

Known Direct Implementers
io.vertx.core.net.impl.SocketAddressImpl
Annotations
@VertxGen
Imports
io.vertx.codegen.annotations.CacheReturn, .GenIgnore, .VertxGen, io.vertx.core.impl.Arguments, io.vertx.core.net.impl.SocketAddressImpl, java.net.InetSocketAddress

The address of a socket, an inet socket address or a domain socket address.

Use inetSocketAddress(int, String) to create an inet socket address and domainSocketAddress(String) to create a domain socket address

Author
Tim Fox

Method Summary

Modifier and TypeMethod and Description
public static SocketAddress

Returns:

the created socket address
domainSocketAddress
(String
the address path
path
)

Create a domain socket address from a path.

public String

Returns:

the host address
host
()

Returns the host name when available or the IP address in string representation.

public String

Returns:

the host address
hostAddress
()

Returns the host IP address when available or null as a String.

public String

Returns:

the host name
hostName
()

Returns the host name when available or null Domain socket address returns null.

public static SocketAddress

Returns:

the created socket address
inetSocketAddress
(int
the port
port
,
String
the host
host
)

Create an inet socket address, host must be non null and port must be between 0 and 65536.

public static SocketAddress

Returns:

the created socket address
inetSocketAddress
(InetSocketAddress
the address
address
)

Create a inet socket address from a Java InetSocketAddress.

public boolean

Returns:

true for an domain socket address
isDomainSocket
()

public boolean

Returns:

true for an inet socket address
isInetSocket
()

public String

Returns:

the domain socket path or null for inet socket address, empty path represents unnamed domain socket addresses.
path
()

public int

Returns:

the address port or -1 for a domain socket
port
()

public static SocketAddress

Returns:

the created socket address
sharedRandomPort
(int
the shared random port id
id
,
String
the host
host
)

Create an inet socket address that binds to a shared random port identified by id.

Method Detail

domainSocketAddressback to summary
public static SocketAddress domainSocketAddress(String path)

Create a domain socket address from a path.

Parameters
path:String

the address path

Returns:SocketAddress

the created socket address

hostback to summary
public String host()

Returns the host name when available or the IP address in string representation.
Domain socket address returns null.

Returns:String

the host address

Annotations
@CacheReturn
hostAddressback to summary
public String hostAddress()

Returns the host IP address when available or null as a String.
Domain socket address returns null.

Returns:String

the host address

Annotations
@CacheReturn
hostNameback to summary
public String hostName()

Returns the host name when available or null
Domain socket address returns null.

Returns:String

the host name

Annotations
@CacheReturn
inetSocketAddressback to summary
public static SocketAddress inetSocketAddress(int port, String host)

Create an inet socket address, host must be non null and port must be between 0 and 65536.
The host string can be a host name or a host address.
No name resolution will be attempted.

Parameters
port:int

the port

host:String

the host

Returns:SocketAddress

the created socket address

inetSocketAddressback to summary
public static SocketAddress inetSocketAddress(InetSocketAddress address)

Create a inet socket address from a Java InetSocketAddress.
No name resolution will be attempted.

Parameters
address:InetSocketAddress

the address

Returns:SocketAddress

the created socket address

Annotations
@GenIgnore:permitted-type
isDomainSocketback to summary
public boolean isDomainSocket()
Returns:boolean

true for an domain socket address

Annotations
@CacheReturn
isInetSocketback to summary
public boolean isInetSocket()
Returns:boolean

true for an inet socket address

Annotations
@CacheReturn
pathback to summary
public String path()
Returns:String

the domain socket path or null for inet socket address, empty path represents unnamed domain socket addresses.

Annotations
@CacheReturn
portback to summary
public int port()
Returns:int

the address port or -1 for a domain socket

Annotations
@CacheReturn
sharedRandomPortback to summary
public static SocketAddress sharedRandomPort(int id, String host)

Create an inet socket address that binds to a shared random port identified by id.
The host string can be a host name or a host address.
No name resolution will be attempted.

Parameters
id:int

the shared random port id

host:String

the host

Returns:SocketAddress

the created socket address