Skip to content

Commit

Permalink
Fix the aes listener socket
Browse files Browse the repository at this point in the history
Used to tls socket addr and port instead of its own.
  • Loading branch information
cvaroqui committed Jul 15, 2019
1 parent 118927e commit 78edb21
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/osvcd_lsnr.py
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 78edb21

Please sign in to comment.