Use provided host in server-started-message
Fixes #302.
I had to lift the logic that defaults port and bind from inet-socket up into start-server – otherwise they were nil on the server record. That does mean that they're now non-nil when socket is provided, but it shouldn't cause an issue as we always check socket first when it's relevant.
The last commit changes as-nrepl-uri to prefer cond over multiple nested if-lets; I recommend reviewing the commits one-by-one because of this.
Looking at the CI failures it seems to me that IPv6 is probably not available on the test instances. Perhaps we can make such tests conditional?
ERROR in nrepl.cmdline-test/server-started-message (Net.java:-2)
edn transport
Uncaught exception, not in assertion.
Exception: java.net.SocketException: Protocol family unavailable
Also - should we document somewhere this behavior?
I took a closer look at the code and all of the changes look good to me. Feel free to merge, after you get the CI to pass.
I'll review it once the tests pass. When I was doing the configuration work, I had some issue with defaulting port to 0 early, but I don't quite remember what that was. Probably something in the tests.
@cichli I plan to cut a new nREPL release early next week, so if you want this to be a part of it, you should try to wrap up the PR over the weekend.
@cichli Can you update this PR?