Lines Matching refs:port

24  * This class represents a socket endpoint described by a IP address and a port
34 private final int port;
43 this.port = -1;
47 * Creates a socket endpoint with the given port number {@code port} and
48 * no specified address. The range for valid port numbers is between 0 and
51 * @param port
52 * the specified port number to which this socket is bound.
54 public InetSocketAddress(int port) {
55 this((InetAddress) null, port);
59 * Creates a socket endpoint with the given port number {@code port} and
60 * {@code address}. The range for valid port numbers is between 0 and 65535
64 * @param port
65 * the specified port number to which this socket is bound.
69 public InetSocketAddress(InetAddress address, int port) {
70 if (port < 0 || port > 65535) {
71 throw new IllegalArgumentException("port=" + port);
75 this.port = port;
79 * Creates a socket endpoint with the given port number {@code port} and the
81 * {@code null}. The range for valid port numbers is between 0 and 65535
84 * @param port
85 * the specified port number to which this socket is bound.
89 public InetSocketAddress(String host, int port) {
90 this(host, port, true);
97 InetSocketAddress(String hostname, int port, boolean needResolved) {
98 if (hostname == null || port < 0 || port > 65535) {
99 throw new IllegalArgumentException("host=" + hostname + ", port=" + port);
112 this.port = port;
122 * @param port
123 * the specified port number to which this socket is bound.
126 * if the hostname {@code host} is {@code null} or the port is
129 public static InetSocketAddress createUnresolved(String host, int port) {
130 return new InetSocketAddress(host, port, false);
134 * Returns this socket address' port.
137 return port;
177 * unresolved {@code InetSocketAddress}) and port number.
181 return ((addr != null) ? addr.toString() : hostname) + ":" + port;
187 * equal and they are bound to the same port.
205 if (port != iSockAddr.port) {
227 return hostname.hashCode() + port;
229 return addr.hashCode() + port;