Commit 736fd828 authored by Antoine Millet's avatar Antoine Millet

Pythonization + comments

parent 1b9e9926
......@@ -193,7 +193,6 @@ class RpcConnection(object):
handler.
'''
# Try to received remaining data from the socket:
if buf == '':
try:
buf = self._sock.recv(self._remains)
except socket.error as err:
......@@ -205,9 +204,12 @@ class RpcConnection(object):
return
else:
raise
if not buf:
# Empty data on non-blocking socket means that the connection
# has been closed:
self.shutdown()
self._remains -= len(buf)
self._remains -= len(buf)
if self._proto_receiving is None:
self._inbound_buffer += buf
if self._remains == 0:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment