code: def read_frame(self):
          
          header = Header.decode_header(self.stream)
          if header.flags:
              raise WebSocketError
          if not header.length:
              return header, ''
          try:
              payload = self.stream.read(header.length)
          except socket_error:
              payload = ''
          except Exception:
              logger.debug("{}: {}".format(type(e), six.text_type(e)))
              payload = ''
          if len(payload) != header.length:
              raise WebSocketError('Unexpected EOF reading frame payload')
          if header.mask:
              payload = header.unmask_payload(payload)
          return header, payload
docs: Block until a full frame has been read from the socket.
  
          This is an internal method as calling this will not cleanup correctly
          if an exception is called. Use `receive` instead.
  
          :return: The header and payload as a tuple.