mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-25 11:18:27 +08:00
coredevice/comm_tcp: raise exception on connection closed
This commit is contained in:
parent
283695e8aa
commit
e5f7fcc339
@ -30,7 +30,10 @@ class Comm(CommGeneric, AutoDB):
|
||||
def read(self, length):
|
||||
r = bytes()
|
||||
while len(r) < length:
|
||||
r += self.socket.recv(min(8192, length - len(r)))
|
||||
rn = self.socket.recv(min(8192, length - len(r)))
|
||||
if not rn:
|
||||
raise IOError("Connection closed")
|
||||
r += rn
|
||||
return r
|
||||
|
||||
def write(self, data):
|
||||
|
Loading…
Reference in New Issue
Block a user