Skip to contentSkip to conversation

SO_REUSEADDR behavior different from BSD

DISCUSSION Michael T Kerrisk 1 participant 1 message Aug 5, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw
Quoted 8 lines

In article <[email protected]> (at Thu, 5 Aug 2004 18:36:17 +0200 (MEST)), "Michael T Kerrisk" <[email protected]> says:

Quoted 4 lines

Now, on Linux, at this point, the second instance of the server fails with EADDRINUSE, even though it did use SO_REUSEADDR. On FreeBSD 5.1, the second server instance does successfully bind.

Quoted 4 lines

This behavior is intended.
First socket is REQUIRED to set SO_REUSEADDR I hate BSD's behavior because it is asynmetry. (Both sockets are required to agree on "REUSEADDR.")

Hideaki, David,

Thank you for the information / confirmation that this is intended behavior. I'll try to see that something on this point makes it into the man pages.

Cheers,

Michael

Signature · 5 lines
Michael Kerrisk
[email protected]

NEU: WLAN-Router für 0,- EUR* - auch für DSL-Wechsler!
GMX DSL = supergünstig & kabellos http://www.gmx.net/de/go/dsl