classification
Title: SocketServer allow_reuse_address checked in constructor
Type: Stage:
Components: Library (Lib) Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: collinwinter, georg.brandl, parente
Priority: normal Keywords:

Created on 2006-11-13 16:54 by parente, last changed 2007-03-10 14:44 by collinwinter. This issue is now closed.

Messages (6)
msg30534 - (view) Author: Peter Parente (parente) Date: 2006-11-13 16:54
Python 2.4.3 (#1, Oct  1 2006, 18:00:19)
[GCC 4.1.1 20060928 (Red Hat 4.1.1-28)] on linux2

The documentation in the SocketServer class indicates
that the allow_reuse_address flag may be set on a
SocketServer subclass *or instance.* However, the flag
is read in a call to the server_bind() from the
constructor of the server object. Therefore, setting
the flag on a created instance has no effect. This is
problematic when trying to set the flag on
SimpleXMLRPCServer instances, for instance, which are
often not subclassed.

This flag should probably become one of the keyword
arguments in the constructor of a SocketServer object.
msg30535 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-11-15 17:34
Would you want to work on a patch for this?
msg30536 - (view) Author: Peter Parente (parente) Date: 2006-11-17 03:28
Will do.
msg30537 - (view) Author: Peter Parente (parente) Date: 2006-11-20 17:07
The SimpleXMLRPCServer class in SVN HEAD now has allow_reuse_address set to True by default. This mimics the implementation of the BaseHTTPServer class which also has it set to True. Therefore, this patch should probably not concentrate on just making allow_reuse_address flag accessible on instances via __init__. Instead, the patch should probably be for TCPServer and specify whether server_bind and server_activate are called automatically or not by the constructor. The default behavior will remain the same as it is now. Specifying False on this flag will allow a developer to set the various variables on a TCPServer server instance before invoking bind/activate manually.
msg30538 - (view) Author: Peter Parente (parente) Date: 2006-11-20 17:16
Submitted as patch #1599845 in patch tracker.
msg30539 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2007-03-10 14:44
Fixed by applying patch #1599845 as r54262. Thanks for your bug report!
History
Date User Action Args
2006-11-13 16:54:22parentecreate