The following code is used in src/clj/clojure/core/server.clj to validate whether a port number is valid:
However this is very slightly incorrect, since port 65535 is excluded but it is actually a valid port.
This is corroborated by ServerSocket's Javadoc:
IllegalArgumentException - if the port parameter is outside the specified range of valid port values, which is between 0 and 65535, inclusive.
Prescreened: Alex Miller
Hi Keyhan, have you signed the Clojure Contributor Agreement? https://clojure.org/community/contributing. If not, please do so.
Another, maybe better, solution here is (<= 0 port 65535) - that reads more closely to the check.
Yes, just earlier today.
I agree that looks better. Current patch is port-65535-obo-v2.patch.