Path: utzoo!attcan!uunet!know!news.cs.indiana.edu!att!emory!gatech!uflorida!atlantis.cis.ufl.edu!leh From: leh@atlantis.cis.ufl.edu (Les Hill) Newsgroups: comp.unix.programmer Subject: Re: Problem with binding of socket addresses Message-ID: <25891@uflorida.cis.ufl.EDU> Date: 12 Dec 90 20:54:12 GMT References: <1990Dec10.194130.20414@athena.mit.edu> Sender: news@uflorida.cis.ufl.EDU Reply-To: leh@atlantis.cis.ufl.edu (Les Hill) Organization: U of Florida. Computer Science Dept. Lines: 23 In article <1990Dec10.194130.20414@athena.mit.edu>, jik@athena.mit.edu (Jonathan I. Kamens) writes: |> Using the reuse address socket option will make it possible for you to |> rebind to the socket. It's also a violation of the TCP protocol. But what |> the hell, sometimes pragmatism has to win out over theory. This is definitely |> one of those times :-). Ummm... I think you got it backwards, the SO_REUSEADDR allows you to override a restriction on sockets (namely each bound INET socket must be bound to a unique local port/local address combination) -- the TCP protocol allows TCP connections to be specified by local port/local address + foriegn port/foriegn address pairs (at least it did when I read RFC 793 :) which probably caused consternation among the socket mechanism developers who had to deal with passive TCP sockets waiting on *any* foriegn address. I would like to hear an authoritative answer to this question: if you set SO_REUSEADDR on a socket, connect to a foreign address, and drop the connection, while someone else (also using SO_REUSEADDR :) issues a bind for the same local port, will the bind call allow you to rebind to the local port/local address within 2*MSL of your drop? If so, what if you proceed with a connect? This would explain why some code checks for EADDRINUSE even after doing a SO_REUSEADDR (then again those folks and I could just be taking "useless" precautions :-> Les -- Extraordinary crimes against the people and the state have to be avenged by agents extraordinary. Two such people are John Steed -- top professional, and his partner, Emma Peel -- talented amateur; otherwise known as "The Avengers." UUCP: ...!gatech!uflorida!leh BITNET: vishnu@UFPINE INTERNET: leh@ufl.edu