Skip to content
Permalink
Browse files

Fix the aes listener socket

Used to tls socket addr and port instead of its own.
  • Loading branch information...
cvaroqui committed Jul 15, 2019
1 parent 118927e commit 78edb2104760a74d250f3d0c8939e30d0c30605c
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/osvcd_lsnr.py
@@ -590,12 +590,13 @@ def filter_change(change):
event["data"] = changes
return event

@staticmethod
def bind_inet(sock, addr, port):
def bind_inet(self, sock, addr, port):
"""
Retry bind until the error is no longer "in use"
"""
while True:
if self.stopped():
break
try:
sock.bind((addr, port))
break
@@ -646,7 +647,7 @@ def setup_sock(self):
self.addr = addrinfo[4][0]
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
self.bind_inet(self.sock, self.tls_addr, self.tls_port)
self.bind_inet(self.sock, self.addr, self.port)
self.sock.listen(128)
self.sock.settimeout(self.sock_tmo)
except socket.error as exc:

0 comments on commit 78edb21

Please sign in to comment.
You can’t perform that action at this time.