'Send raw data across the stream.
:param string data: Any string value.
:param bool reconnect: Indicates if the stream should be
restarted if there is an error sending
the stanza. Used mainly for testing.
Defaults to :attr:`auto_reconnect`.'

def send_raw(self, data, now=False, reconnect=None):

    if now:
        log.debug(u'SEND    (IMMED):    %s', data)
        try:
            data = data.encode(u'utf-8')
            total = len(data)
            sent = 0
            count = 0
            tries = 0
            with self.send_lock:
                while ((sent < total) and (not self.stop.is_set())):
                    try:
                        sent += self.socket.send(data[sent:])
                        count += 1
                    except ssl.SSLError as serr:
                        if (tries >= self.ssl_retry_max):
                            log.debug(u'SSL    error:    max    retries    reached')
                            self.exception(serr)
                            log.warning(u'Failed    to    send    %s', data)
                            if (reconnect is None):
                                reconnect = self.auto_reconnect
                            if (not self.stop.is_set()):
                                self.disconnect(reconnect, send_close=False)
                            log.warning(u'SSL    write    error:    retrying')
                        if (not self.stop.is_set()):
                            time.sleep(self.ssl_retry_delay)
                        tries += 1
                    except Socket.error as serr:
                        if (serr.errno != errno.EINTR):
                            raise
            if (count > 1):
                log.debug(u'SENT:    %d    chunks', count)
        except (Socket.error, ssl.SSLError) as serr:
            self.event(u'socket_error', serr, direct=True)
            log.warning(u'Failed    to    send    %s', data)
            if (reconnect is None):
                reconnect = self.auto_reconnect
            if (not self.stop.is_set()):
                self.disconnect(reconnect, send_close=False)
    else:
        self.send_queue.put(data)
    return True
