code: def socket_recvall(socket, length, bufsize=4096):
      
      data = b""
      while len(data) < length:
          data += socket.recv(bufsize)
      return data
docs: A helper method to read of bytes from a socket to a maximum length