'Send data over the connection.
It will first be encoded into JSON, and optionally followed with
a newline.  Ultimately, it will be passed to send_raw() to actually
be sent.'

def send(self, whatever):

    if (self._is_connected is False):
        return False
    s = json.dumps(whatever, default=str)
    if self._newlines:
        s += '\n'
    self.send_raw(s)
    return True
