Remove self.set_reuse_addr from asyncore code

This commit is contained in:
Thomas Adamcik 2011-06-07 16:05:26 +02:00
parent 8b9fb90449
commit 387d72ef67
2 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,6 @@ class MpdServer(asyncore.dispatcher):
"""Start MPD server."""
try:
self.socket = network.create_socket()
self.set_reuse_addr()
hostname = network.format_hostname(settings.MPD_SERVER_HOSTNAME)
port = settings.MPD_SERVER_PORT
logger.debug(u'MPD server is binding to [%s]:%s', hostname, port)

View File

@ -27,6 +27,7 @@ def create_socket():
sock.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 0)
else:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
return sock
def format_hostname(hostname):