diff options
Diffstat (limited to 'Lib/dos-8x3/socketse.py')
-rwxr-xr-x | Lib/dos-8x3/socketse.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/dos-8x3/socketse.py b/Lib/dos-8x3/socketse.py index 2c73356..5562fb0 100755 --- a/Lib/dos-8x3/socketse.py +++ b/Lib/dos-8x3/socketse.py @@ -141,6 +141,7 @@ class TCPServer: - address_family - socket_type - request_queue_size (only for stream sockets) + - reuse_address Instance variables: @@ -156,6 +157,8 @@ class TCPServer: request_queue_size = 5 + allow_reuse_address = 0 + def __init__(self, server_address, RequestHandlerClass): """Constructor. May be extended, do not override.""" self.server_address = server_address @@ -171,6 +174,8 @@ class TCPServer: May be overridden. """ + if self.allow_reuse_address: + self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) self.socket.bind(self.server_address) def server_activate(self): |