r/AskProgramming • u/Entrobbit • May 02 '26
How avoid Port Bind Collision (theoretic)
Hey,
i am in denial that all this somehow works.
I got into application programming, and axum server and using ports.
And i am paranoid to accidentally get a port collision.
I know there are "reserved" spaces like low ones for os, and high ones for ephimeral client ones.
And like ~8000 for dev stuff.
but it just doesnt work in my brain that if i bind my app to e.g. 3435.
What if i then start syncthing (afaik also binds to 3435 for web UI)?
My fear is that if for some reason an unlucky pair of apps wants to bind to the same port, the 2. one just crashes, no?
And you can't just use random free ones, cuz then noone knows where to reach you? (like for a web server/servers).
So how are these collisions getting avoided?
View all comments
Show parent comment
1
u/Entrobbit May 02 '26 edited May 02 '26
i don't wanna be stubborn, but it just doesn't make sense to me.
like even if i do choose a "weird" port like 9215 :)
and someone elses app happens to use the same.
i have never heard of manually having to change the port.
and even then if sth wants to connect and expects the og port :[.
(e) fucking m-dash 😑