API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.net. InetSocketAddress View Source
Author(s)
Since
1.4
Version
Serial
Hierarchy
 Object
      SocketAddress
          InetSocketAddress
Implements
Subclasses
Description
public class InetSocketAddress
  This class implements 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.
See also:    Socket ServerSocket
Constructors
private InetSocketAddress ()
public InetSocketAddress (InetAddress addr, int port)
  Creates a socket address from an IP address and a port number.
public InetSocketAddress (int port)
  Creates a socket address where the IP address is the wildcard address and the port number a specified value.
public InetSocketAddress (String hostname, int port)
  Creates a socket address from a hostname and a port number.
Methods
Hide/Show inherited methods
publicstatic InetSocketAddress createUnresolved (String host, int port)
  Creates an unresolved socket address from a hostname and a port number.
publicfinal boolean equals (Object obj)
  Compares this object against the specified object.
publicfinal InetAddress getAddress ()
  Gets the InetAddress.
publicfinal String getHostName ()
  Gets the hostname.
pack-privatefinal String getHostString ()
  Returns the hostname, or the String form of the address if it doesn't have a hostname (it was created using a litteral).
publicfinal int getPort ()
  Gets the port number.
publicfinal int hashCode ()
  Returns a hashcode for this socket address.
publicfinal boolean isUnresolved ()
  Checks whether the address has been resolved or not.
public String toString ()
  Constructs a string representation of this InetSocketAddress.
Fields
Hide/Show inherited fields
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar