final class InetSocketAddress extends SocketAddress
Representation of an IP Socket Address (IP address + port number).
It can also be a pair (hostname + port number), in which case an attempt will be made to resolve the hostname. If resolution fails then the address is said to be unresolved but can still be used on some circumstances like connecting through a proxy. However, note that network channels generally do not accept unresolved socket addresses.
This class provides an immutable object used by sockets for binding, connecting, or as returned values.
The wildcard is a special local IP address. It usually means "any" and can only be used for bind operations.
- Alphabetic
- By Inheritance
- InetSocketAddress
- SocketAddress
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def address: Option[InetAddress]
The socket's address.
The socket's address.
- returns
The address of the socket, or
None
if this socket address is not resolved.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def equals(obj: Any): Boolean
- Definition Classes
- SocketAddress → AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def hashCode(): Int
- Definition Classes
- SocketAddress → AnyRef → Any
- def hostName(implicit trace: Trace): UIO[String]
Gets the hostname.
Gets the hostname.
Note: This method may trigger a name service reverse lookup if the address was created with a literal IP address.
- def hostString(implicit trace: Trace): UIO[String]
Returns the hostname, or the String form of the address if it doesn't have a hostname (it was created using a literal).
Returns the hostname, or the String form of the address if it doesn't have a hostname (it was created using a literal).
This has the benefit of not attempting a reverse lookup. This is an effect because the result could change if a reverse lookup is performed, for example by calling
hostName
. - final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isUnresolved: Boolean
Checks whether the address has been resolved or not.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def port: Int
The socket's port number.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- final def toString(): String
- Definition Classes
- SocketAddress → AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()