def METHOD_NAME(self, data):
    # Replace newlines with Unicode line separator for multi-line events
    multiline = data.replace("\n", self.LINE_SEP) + "\n"
    # Send data, reconnect if needed
    while True:
        try:
            self._conn.send(multiline)
        except OSError:
            self.reopen_connection()
            continue
        break
    self.close_connection()