Kaydet (Commit) 93a6327a authored tarafından Barry Warsaw's avatar Barry Warsaw

SMTPServer.__init__(): The asyncore.dispatcher base class has a method

set_reuse_addr() that does the setsockopt fiddling.  Use it instead.
üst 6959a2fc
......@@ -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, \
......
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