Thread (7 messages) flat view 7 messages, 5 authors, 2004-08-09

Re: SO_REUSEADDR behavior different from BSD

From: Michael T Kerrisk <hidden>
Date: 2004-08-09 13:29:30

At 11:34 05/08/2004 -0700, YOSHIFUJI Hideaki wrote:
quoted
quoted
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.
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.")
Not sure what you mean by "asymetry".
Ferando,

By asymmetry, I understand Hideaki to mean that BSD requires 
SO_REUSEADDR in the second server bind(), but not the first.
the Linux philosophy then appears to be symmetry: both server
instances must agree that the socket port is reusable (i.e., 
both must set SO_REUSEADDR).

Cheers,

Michael

-- 
Michael Kerrisk
mtk-lists@gmx.net

NEU: WLAN-Router f�r 0,- EUR* - auch f�r DSL-Wechsler!
GMX DSL = superg�nstig & kabellos http://www.gmx.net/de/go/dsl
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help