<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _read_packet(self):
 """ Reads next TDS packet from the underlying transport If timeout is happened during reading of packet's header will cancel current request. Can only be called when transport's read pointer is at the begining of the packet. """

        try:
            pos = 0
            while pos < _header.size:
                received = self._transport.recv_into(self._bufview[pos:_header.size-pos])
                if received == 0:
                    raise tds_base.ClosedConnectionError()
                pos += received
        except tds_base.TimeoutError:
            self._session.put_cancel()
            raise
        self._pos = _header.size
        self._type, self._status, self._size, self._session._spid, _ = _header.unpack_from(self._bufview, 0)
        self._have = pos
        while pos < self._size:
            received = self._transport.recv_into(self._bufview[pos:], self._size - pos)
            if received == 0:
                raise tds_base.ClosedConnectionError()
            pos += received
            self._have += received