So_reuseaddr naming is more accurate on Windows SO_REUSEADDR has a completely different meaning on Windows - which I did not know since I never tried it. On Linux, SO_REUSEADDR just lets you rebind a port stuck in TIME_WAIT. It WON'T allow multiple active listeners on the same port. On Windows, it is permissive. Multiple sockets CAN bind to the same address and port if they all set SO_REUSEADDR, which breaks exclusivity. Instead, we need to use the option SO_EXCLUSIVEADDRUSE. More interestingly, on macOS , it sits in between. SO_REUSEADDR can allow multiple binds under certain conditions (ask an LLM or read the man page for more on that). Same name. Different guarantees. |
No comments yet