New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Check if port is available to listen on #36428
Comments
detailed Linux version: |
I think this seems to be expected behavior.
|
You are right. That is indeed the expected outcome. Unfortunately, we do not have an API that allows checking whether a port is available or not. |
A possible workaround is to write custom code, maybe by checking the contents of I'm going to keep this around to see if others are interested in this. I'm unsure if this is something gRPC should be doing. |
Thanks, My proposal to API extension: case1: case2:
if fails in(a) (or PortNumber in addr_uri == 0)
|
What version of gRPC and what language are you using?
1.62.1
What operating system (Linux, Windows,...) and version?
Linux
What runtime / compiler are you using (e.g. python version or version of gcc)
gcc 11.4.0
What did you do?
This is example code:
It seems that port_selected variable is set to correct value after call builder.BuildAndStart()
What did you expect to see?
Correct port value after call builder.AddListeningPort
What did you see instead?
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
See TROUBLESHOOTING.md for how to diagnose problems better.
Anything else we should know about your project / environment?
The text was updated successfully, but these errors were encountered: