Find unused port for codechecker server#3663
Conversation
bruntib
left a comment
There was a problem hiding this comment.
Thanks for the improvement, it's a very nice job!
I think, however, that finding a free port shouldn't be an automatic thing even in case of using the default port. If the default port (8001) is not free then it still should be an error. We should only get a free port from os only if the user explicitly provides port 0.
|
so the user can just use |
|
Oh, sorry, the specification in the original ticket is not accurate. You implemented it according to the specification, but I think we shouldn't consider port 8001 as a special case. We should choose one of these alternatives:
In my previous comment I suggested the first option, because many other CodeChecker commands are assuming this port number. For example |
|
without my commit these are the scenarios: |
|
could change the error message to say "Server can't be started ... use |
|
Yes, that message would be a good solution. I've checked the original version of this ticket in an internal ticket system and this task belonged to an old CodeChecker version. Port 0 really works as expected by now, sorry, I haven't checked it before creating this ticket. My bad :( |
|
no problem. I canceled the changes, and just changed the message |
Hi, this closes #3657.
if default port is not available, and the user didn't ask for a specific one - let the os find a port.