xsc / minion

Clojure '-main' helper
Eclipse Public License 1.0
8 stars 2 forks source link

java.net.BindException: Address already in use #1

Closed nickzam closed 3 years ago

nickzam commented 9 years ago

If port is used by another app/nrepl minion generates exception (see title) and exits. May be it would be better to try to find next free port for minion's nrepl to continue operation?

xsc commented 9 years ago

@nickzam The REPL port is supposed to be set explicitly, either using :default-port in defmain, the --repl-port command line switch or :repl-port option map entry. If you want to have multiple instances of your application running, you have to explicitly tell them which port to choose.

I'll look into the possibility of having port ranges/multiple ports in defmain, though, i.e.:

(defmain -main
  :default-port [1234 1235 1236]
  ...)

And the first free one could be chosen. Alternatively, setting the value to :any could prompt your desired behaviour. I'll report back once there is movement.