def _write(self, data):
OUT_LOGGER.debug("<STR_LIT>", data)<EOL>if self._hup or not self._socket:<EOL><INDENT>raise PyXMPPIOError("<STR_LIT>")<EOL><DEDENT>try:<EOL><INDENT>while data:<EOL><INDENT>try:<EOL><INDENT>sent = self._socket.send(data)<EOL><DEDENT>except ssl.SSLError as err:<EOL><INDENT>if err.args[<NUM_LIT:0>] == ssl.SSL_ERROR_WANT_WRITE:<EOL><INDENT>continue<EOL><DEDENT>else:<EOL><INDENT>raise<EOL><DEDENT><DEDENT>except socket.error as err:<EOL><INDENT>if err.args[<NUM_LIT:0>] == errno.EINTR:<EOL><INDENT>continue<EOL><DEDENT>if err.args[<NUM_LIT:0>] in BLOCKING_ERRORS:<EOL><INDENT>wait_for_write(self._socket)<EOL>continue<EOL><DEDENT>raise<EOL><DEDENT>data = data[sent:]<EOL><DEDENT><DEDENT>except (IOError, OSError, socket.error) as err:<EOL><INDENT>raise PyXMPPIOError("<STR_LIT>".format(err))<EOL><DEDENT>
Write raw data to the socket.

        :Parameters:
            - `data`: data to send
        :Types:
            - `data`: `bytes`