summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2001-10-09 15:46:31 (GMT)
committerBarry Warsaw <barry@python.org>2001-10-09 15:46:31 (GMT)
commit93a6327adff7274cbfb47f3b8c73970f0605e787 (patch)
treea79798912dbdb32330188ebbd16026f9c7da8b63 /Lib
parent6959a2fcd75e20515b0d1d2c24b5d409b89e3421 (diff)
downloadcpython-93a6327adff7274cbfb47f3b8c73970f0605e787.zip
cpython-93a6327adff7274cbfb47f3b8c73970f0605e787.tar.gz
cpython-93a6327adff7274cbfb47f3b8c73970f0605e787.tar.bz2
SMTPServer.__init__(): The asyncore.dispatcher base class has a method
set_reuse_addr() that does the setsockopt fiddling. Use it instead.
Diffstat (limited to 'Lib')
-rwxr-xr-xLib/smtpd.py4
1 files changed, 1 insertions, 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, \