utils.socket

Module Contents

Classes

SocketError()

Functions

read(socket,n=4096) Reads at most n bytes from socket
read_exactly(socket,n) Reads exactly n bytes from socket
next_frame_size(socket) Returns the size of the next frame of data waiting to be read from socket,
frames_iter(socket) Returns a generator of frames read from socket
socket_raw_iter(socket) Returns a generator of data read from the socket.
class SocketError
read(socket, n=4096)

Reads at most n bytes from socket

read_exactly(socket, n)

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

next_frame_size(socket)

Returns the size of the next frame of data waiting to be read from socket, according to the protocol defined here:

https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/#/attach-to-a-container

frames_iter(socket)

Returns a generator of frames read from socket

socket_raw_iter(socket)

Returns a generator of data read from the socket. This is used for non-multiplexed streams.