Skip to content

Commit

Permalink
Raise an EOFException on short reads
Browse files Browse the repository at this point in the history
  • Loading branch information
gartens committed Oct 8, 2024
1 parent 7794722 commit 56ff490
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions polypheny/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ def send_msg(self, serialized):

def recv_msg(self):
bl = self.con.recv(8)
if len(bl) != 8:
raise EOFError
n = int.from_bytes(bl, 'little')
raw = self.con.recv(n)
if len(raw) != n:
Expand Down

0 comments on commit 56ff490

Please sign in to comment.