Browsing the source, I see the Stdio/file module is littered with SO_REUSEADDR setsockopts of which *all* of them are bogus (i.e. they either have no effect, or have an effect which is detrimental to the socket's operation and could cause the socket to receive unexpected errors because the network is still delivering lingering packets to a newly reused socket).
It looks like they were scattered into the code by someone who either does not fully understand its semantics, or in a futile attempt to camouflage certain network problems (but were never removed again because it was uncertain if they helped or not (they do not help!)).
I've already noticed this while fixing the network-tests from the test-suite. Can anybody either explain what the excessive use of SO_REUSEADDR was supposed to accomplish? Grubba? (it seems like you added or at least touched some of them), or does anybody object to me cleaning up this mess?
The reason why I actually touch the subject is because I currently happen to have one of the two only valid reasons to actually use SO_REUSEADDR (I want to bind two Roxens to the same port on the same IP-address for load balancing), and it turns out that I cannot activate the option from Pike (ironically, the code is littered with these SO_REUSEADDR options, except for the one spot where it actually matters). It should/will become a separate setsockopt kind of interface at the Pike level.
pike-devel@lists.lysator.liu.se