def _read_buf(self, datalen):
        """Read and consume bytes from socket connection

        It's expected that the caller handles e.g. blocking exceptions"""
        buf = self._peek_buf(datalen)
        if buf:
            self._buffer_in = self._buffer_in[len(buf):]
        return buf
Read and consume bytes from socket connection

        It's expected that the caller handles e.g. blocking exceptions
kafka/socks5_wrapper.py