[Python-Dev] reuse of address default value (was Re: [Python-checkins] CVS: python/dist/src/Lib SocketServer.py)

Jack Jansen jack@oratrix.nl
Fri, 15 Dec 2000 15:26:15 +0100


> The reason for the patch is that without this, if you kill a TCP server
> and restart it right away, you'll get a 'port in use" error -- TCP has
> some kind of strange wait period after a connection is closed before
> it can be reused.  The patch avoids this error.

Well, actually there's a pretty good reason for the "port in use" behaviour: 
the TCP standard more-or-less requires it. A srchost/srcport/dsthost/dstport 
combination should not be reused until the maximum TTL has passed, because 
there may still be "old" retransmissions around. Especially the "open" packets 
are potentially dangerous.

Setting the reuse bit while you're debugging is fine, but setting it in 
general is not a very good idea...
--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack    | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm