-
-
Save jeroenvandijk/6a4bd7db923e4e959d87cf7d8829b2d6 to your computer and use it in GitHub Desktop.
find free port in clojure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn get-free-port [] | |
(with-open [socket (java.net.ServerSocket. 0)] | |
(.getLocalPort socket))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment