Gregory Ewing <greg.ew...@canterbury.ac.nz>: > Marko Rauhamaa wrote: >> Nevertheless, the later socket object cannot unilaterally take over a >> socket using SO_REUSEADDR. The earlier socket object must have set the >> same option previously. > > I just did an experiment that suggests that's not the case. > I created a socket without SO_REUSEADDR, made a connection to > it, and killed it. Then I created another socket within the > timeout period with SO_REUSEADDR, and it succeeded. > > This was on MacOSX -- it's possible that other systems > behave differently.
I tried it, too, (on Linux) and it failed. It's crucial that the killed party is the server for the situation to arise. That's why polite clients close their end of the connection before the server. Whoever closes first will suffer the TIME-WAIT state. Marko -- https://mail.python.org/mailman/listinfo/python-list