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

Not detecting a dropped connection #69

Open
ghost opened this issue Oct 25, 2013 · 0 comments
Open

Not detecting a dropped connection #69

ghost opened this issue Oct 25, 2013 · 0 comments

Comments

@ghost
Copy link

ghost commented Oct 25, 2013

When the graphite server drops the connection it's not detected. Returning if not buf forces the exception from unpack.

def read_all(self, sock, n):
"""
Read n bytes from a stream
"""
data = ''
while n > 0:
buf = sock.recv(n)
if not buf:
return data
n -= len(buf)
data += buf
return data

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants