Skip to content
This repository has been archived by the owner on Dec 18, 2019. It is now read-only.

Break the loop when connection closes. #115

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/horizon/listen.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,14 @@ def read_all(self, sock, n):
"""
data = ''
while n > 0:
buf = sock.recv(n)
n -= len(buf)
data += buf
chunk = sock.recv(n)
count = len(chunk)

if count == 0:
break

n -= count
data += chunk
return data

def check_if_parent_is_alive(self):
Expand Down