From 93a6327adff7274cbfb47f3b8c73970f0605e787 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Tue, 9 Oct 2001 15:46:31 +0000 Subject: SMTPServer.__init__(): The asyncore.dispatcher base class has a method set_reuse_addr() that does the setsockopt fiddling. Use it instead. --- Lib/smtpd.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Lib/smtpd.py b/Lib/smtpd.py index 9406de1..cf6821f 100755 --- a/Lib/smtpd.py +++ b/Lib/smtpd.py @@ -277,9 +277,7 @@ class SMTPServer(asyncore.dispatcher): asyncore.dispatcher.__init__(self) self.create_socket(socket.AF_INET, socket.SOCK_STREAM) # try to re-use a server port if possible - self.socket.setsockopt( - socket.SOL_SOCKET, socket.SO_REUSEADDR, - self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) | 1) + self.set_reuse_addr() self.bind(localaddr) self.listen(5) print >> DEBUGSTREAM, \ -- cgit v0.12