I have a small TCP server that listens on a port. Although debugging for me is usually used for CTRL-C server to kill the process.
On Windows, I can quickly restart the service, and the socket can be bounced. On Linux, I have to wait a few minutes before bind () returns with success
If bind () does not work, it returns errno = 98, the address used.
I would like to better understand the differences in implementation. Windows is confident that it is more developer-friendly, but I kind of doubt that Linux is doing the “wrong thing”.
My best guess: Linux waits until all possible clients find that the old socket is broken before allowing the creation of new sockets. The only way to do this is to wait for them to time out.
Is there a way to change this behavior during development on Linux? I hope to duplicate the way Windows does it
stuck source
share