MCPcopy Index your code
hub / github.com/docker/docker-py / read_exactly

Function read_exactly

docker/utils/socket.py:62–73  ·  view source on GitHub ↗

Reads exactly n bytes from socket Raises SocketError if there isn't enough data

(socket, n)

Source from the content-addressed store, hash-verified

60
61
62def read_exactly(socket, n):
63 """
64 Reads exactly n bytes from socket
65 Raises SocketError if there isn't enough data
66 """
67 data = b""
68 while len(data) < n:
69 next_data = read(socket, n - len(data))
70 if not next_data:
71 raise SocketError("Unexpected EOF")
72 data += next_data
73 return data
74
75
76def next_frame_header(socket):

Callers 3

next_frame_headerFunction · 0.85

Calls 2

readFunction · 0.85
SocketErrorClass · 0.85