mirror of https://github.com/python/cpython
SMTPServer.__init__(): The asyncore.dispatcher base class has a method
set_reuse_addr() that does the setsockopt fiddling. Use it instead.
This commit is contained in:
parent
6959a2fcd7
commit
93a6327adf
|
@ -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, \
|
||||
|
|
Loading…
Reference in New Issue