Java java.net InetSocketAddress fields, constructors, methods, implement or subclass

Example usage for Java java.net InetSocketAddress fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.net InetSocketAddress.

The text is from its open source code.

Constructor

InetSocketAddress(InetAddress addr, int port)
Creates a socket address from an IP address and a port number.
InetSocketAddress(String hostname, int port)
Creates a socket address from a hostname and a port number.
InetSocketAddress(int port, String hostname)
InetSocketAddress(int port)
Creates a socket address where the IP address is the wildcard address and the port number a specified value.

Method

InetSocketAddresscreateUnresolved(String host, int port)
Creates an unresolved socket address from a hostname and a port number.
booleanequals(Object obj)
Compares this object against the specified object.
InetAddressgetAddress()
Gets the InetAddress .
StringgetHostName()
Gets the hostname .
StringgetHostString()
Returns the hostname, or the String form of the address if it doesn't have a hostname (it was created using a literal).
intgetPort()
Gets the port number.
inthashCode()
Returns a hashcode for this socket address.
booleanisUnresolved()
Checks whether the address has been resolved or not.
StringtoString()
Constructs a string representation of this InetSocketAddress.