pnowojski commented on a change in pull request #10184: [FLINK-14481]Modify the
Flink valid socket port check to 0 to 65535.
URL: https://github.com/apache/flink/pull/10184#discussion_r349122592
##########
File path: flink-core/src/main/java/org/apache/flink/util/NetUtils.java
##########
@@ -430,4 +430,24 @@ public static String getWildcardIPAddress() {
public interface SocketFactory {
ServerSocket createSocket(int port) throws IOException;
}
+
+ /**
+ * Check whether the given port is in right range when connecting to
somewhere
+ *
+ * @param port the port to check
+ * @return true if the number in the range 1 to 65535
+ */
+ public static boolean isValidClientPort(int port) {
+ return 1 <= port && port <= 65535;
+ }
+
+ /**
+ * check whether the given port is in right range when getting port
from local system
Review comment:
Same here.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services