Home | History | Annotate | Download | only in net

Lines Matching refs:port

37  * This class implements an IP Socket Address (IP address + port number)
38 * It can also be a pair (hostname + port number), in which case an attempt
62 // The port number of the Socket Address
63 private int port;
65 private InetSocketAddressHolder(String hostname, InetAddress addr, int port) {
68 this.port = port;
72 return port;
106 return hostname + ":" + port;
108 return addr.toString() + ":" + port;
125 return sameIP && (port == that.port);
131 return addr.hashCode() + port;
133 return hostname.toLowerCase().hashCode() + port;
134 return port;
142 private static int checkPort(int port) {
143 if (port < 0 || port > 0xFFFF)
144 throw new IllegalArgumentException("port out of range:" + port);
145 return port;
166 * and the port number a specified value.
168 * A valid port value is between 0 and 65535.
169 * A port number of {@code zero} will let the system pick up an
170 * ephemeral port in a {@code bind} operation.
172 * @param port The port number
173 * @throws IllegalArgumentException if the port parameter is outside the specified
174 * range of valid port values.
176 public InetSocketAddress(int port) {
178 // this(InetAddress.anyLocalAddress(), port);
179 this((InetAddress)null, port);
184 * Creates a socket address from an IP address and a port number.
186 * A valid port value is between 0 and 65535.
187 * A port number of {@code zero} will let the system pick up an
188 * ephemeral port in a {@code bind} operation.
193 * @param port The port number
194 * @throws IllegalArgumentException if the port parameter is outside the specified
195 * range of valid port values.
197 public InetSocketAddress(InetAddress addr, int port) {
203 checkPort(port));
208 * Creates a socket address from a hostname and a port number.
217 * A valid port value is between 0 and 65535.
218 * A port number of {@code zero} will let the system pick up an
219 * ephemeral port in a {@code bind} operation.
222 * @param port The port number
223 * @throws IllegalArgumentException if the port parameter is outside the range
224 * of valid port values, or if the hostname parameter is <TT>null</TT>.
230 public InetSocketAddress(String hostname, int port) {
239 holder = new InetSocketAddressHolder(host, addr, checkPort(port));
243 private InetSocketAddress(int port, String hostname) {
244 holder = new InetSocketAddressHolder(hostname, null, port);
249 * Creates an unresolved socket address from a hostname and a port number.
254 * A valid port value is between 0 and 65535.
255 * A port number of {@code zero} will let the system pick up an
256 * ephemeral port in a {@code bind} operation.
259 * @param port The port number
260 * @throws IllegalArgumentException if the port parameter is outside
261 * the range of valid port values, or if the hostname
268 public static InetSocketAddress createUnresolved(String host, int port) {
269 return new InetSocketAddress(checkPort(port), checkHost(host));
275 * @serialField port int
280 new ObjectStreamField("port", int.class)};
289 pfields.put("port", holder.port);
300 final int oisPort = oisFields.get("port", -1);
334 * Gets the port number.
336 * @return the port number.
388 * and concatenating the port number (with a colon). If the address
405 * address if both the InetAddresses (or hostnames if it is unresolved) and port
407 * If both addresses are unresolved, then the hostname and the port number