Commit b8795c96 authored by Vincent Pelletier's avatar Vincent Pelletier

Do not wait for client (ie Zope) to disconnect when TIDStorage is shut down.

Allow reusing address (allows restarting TIDStorage when it was closed when connections where still established).


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24531 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4e5397cc
......@@ -484,11 +484,8 @@ def log(message):
print >> sys.stdout, '%s: %s' % (time.asctime(), message)
class PoliteThreadingTCPServer(SocketServer.ThreadingTCPServer):
def server_close(self):
# Make the port reusable for listening as soon as the socket closes.
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, True)
self.socket.shutdown(socket.SHUT_RDWR)
self.socket.close()
daemon_threads = True
allow_reuse_address = True
def main(address, port):
server = PoliteThreadingTCPServer((address, port), TIDServer)
......@@ -501,7 +498,6 @@ def main(address, port):
finally:
global can_bootstrap
can_bootstrap = False
log('Waiting for clients to disconnect...')
server.server_close()
log_file_set = sets.Set()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment