@seekset<EOL><INDENT>def _read_packet(self, length=None, *, header=None, payload=None, discard=False):<DEDENT>
if header is not None:<EOL><INDENT>header = self._read_fileng(header)<EOL>payload = self._read_fileng(*[payload])<EOL>if discard:<EOL><INDENT>return payload<EOL><DEDENT>return dict(header=header, payload=payload)<EOL><DEDENT>return self._read_fileng(*[length])<EOL>
Read raw packet data.

        Positional arguments:
            * length -- int, length of the packet

        Keyword arguments:
            * header -- int, length of the packet header
            * payload -- int, length of the packet payload
            * discard -- bool, flag if discard header data (False in default)

        Returns:
            * [if header omits] bytes -- whole packet data
            * [if discard set True] bytes -- packet body only
            * dict -- header and payload data
                |-- 'header' -- bytes, packet header
                |-- 'payload' -- bytes, packet payload