Allow socket address reuse; fixed #1264

The socket may remain in the TIME_WAIT state for some time after the
server shuts down, which prevents another instance of the server from
listening on the same port. This change allows the server to reuse the
address even when it's still waiting.
This commit is contained in:
Rob Kennedy 2014-02-13 15:46:33 -08:00 committed by Justin Mayer
commit 1b6f081619

View file

@ -36,6 +36,7 @@ class ComplexHTTPRequestHandler(srvmod.SimpleHTTPRequestHandler):
Handler = ComplexHTTPRequestHandler
socketserver.TCPServer.allow_reuse_address = True
try:
httpd = socketserver.TCPServer(("", PORT), Handler)
except OSError as e: