def _flush_buf(self):
        """Send out all data that is stored in the outgoing buffer.

        It is expected that the caller handles error handling, including non-blocking
        as well as connection failure exceptions.
        """
        while self._buffer_out:
            sent_bytes = self._sock.send(self._buffer_out)
            self._buffer_out = self._buffer_out[sent_bytes:]
Send out all data that is stored in the outgoing buffer.

        It is expected that the caller handles error handling, including non-blocking
        as well as connection failure exceptions.
        
kafka/socks5_wrapper.py