Skip to content
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

Allow using 0 to auto-select tcp/udp port #5505

Open
arnetheduck opened this issue Oct 16, 2023 · 1 comment
Open

Allow using 0 to auto-select tcp/udp port #5505

arnetheduck opened this issue Oct 16, 2023 · 1 comment

Comments

@arnetheduck
Copy link
Member

Specifying 0 as port should make nimbus let the OS pick a port and subsequently use it in ENR/libp2p/etc

See also waku-org/nwaku#2125

@cheatfate
Copy link
Contributor

This issue is complex to implement, because if you bound TCP socket to 0 port you will get random available TCP port, but its does not guarantee you that if you bind to UDP socket to 0 port you will get same UDP port. It also possible that if you will bound to 0 only TCP socket and try to reuse randomly generated port to UDP socket it could become busy, so this process could take some time to get equal random TCP/UDP port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants