MCPcopy Create free account
hub / github.com/LabPy/lantz / recvfrag

Function recvfrag

lantz/drivers/legacy/rpc.py:262–276  ·  view source on GitHub ↗
(sock)

Source from the content-addressed store, hash-verified

260
261
262def recvfrag(sock):
263 header = sock.recv(4)
264 if len(header) < 4:
265 raise EOFError
266 x = struct.unpack(">I", header[0:4])[0]
267 last = ((x & 0x80000000) != 0)
268 n = int(x & 0x7fffffff)
269 frag = b''
270 while n > 0:
271 buf = sock.recv(n)
272 if not buf:
273 raise EOFError
274 n = n - len(buf)
275 frag = frag + buf
276 return last, frag
277
278
279def recvrecord(sock):

Callers 1

recvrecordFunction · 0.85

Calls 1

recvMethod · 0.45

Tested by

no test coverage detected