TCP IPv6: fix leaking sockets
This commit is contained in:
parent
1ca98c83aa
commit
ba05a29fbb
|
@ -864,6 +864,8 @@ class TCPServer:
|
|||
self.socket.setsockopt(IPPROTO_IPV6, socket.IPV6_V6ONLY, 0)
|
||||
self.socket.bind(self.address)
|
||||
except socket.error:
|
||||
if self.socket:
|
||||
self.socket.close()
|
||||
self.socket = None
|
||||
|
||||
if not self.socket:
|
||||
|
|
Loading…
Reference in New Issue