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

Function next_frame_header

docker/utils/socket.py:76–89  ·  view source on GitHub ↗

Returns the stream and size of the next frame of data waiting to be read from socket, according to the protocol defined here: https://docs.docker.com/engine/api/v1.24/#attach-to-a-container

(socket)

Source from the content-addressed store, hash-verified

74
75
76def next_frame_header(socket):
77 """
78 Returns the stream and size of the next frame of data waiting to be read
79 from socket, according to the protocol defined here:
80
81 https://docs.docker.com/engine/api/v1.24/#attach-to-a-container
82 """
83 try:
84 data = read_exactly(socket, 8)
85 except SocketError:
86 return (-1, -1)
87
88 stream, actual = struct.unpack('>BxxxL', data)
89 return (stream, actual)
90
91
92def frames_iter(socket, tty):

Callers 3

frames_iter_no_ttyFunction · 0.85

Calls 1

read_exactlyFunction · 0.85