'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.'

def read_frame(self):

    header = Header.decode_header(self.stream)
    if header.flags:
        raise ProtocolError
    if (not header.length):
        return (header, '')
    try:
        payload = self.raw_read(header.length)
    except socket.error:
        payload = ''
    except Exception:
        payload = ''
    if (len(payload) != header.length):
        raise WebSocketError('Unexpected    EOF    reading    frame    payload')
    if header.mask:
        payload = header.unmask_payload(payload)
    return (header, payload)
