'Sends a command to the JVM. This method is not intended to be
called directly by Py4J users. It is usually called by
:class:`JavaMember` instances.
:param command: the `string` command to send to the JVM. The command
must follow the Py4J protocol.
:param retry: if `True`, the GatewayClient tries to resend a message
if it fails.
:rtype: the `string` answer received from the JVM. The answer follows
the Py4J protocol.'

def send_command(self, command, retry=True):

    connection = self._get_connection()
    try:
        response = connection.send_command(command)
        self._give_back_connection(connection)
    except Py4JNetworkError:
        if retry:
            logging.info(u'Exception    while    sending    command.', exc_info=True)
            response = self.send_command(command)
        else:
            logging.exception(u'Exception    while    sending    command.')
            response = proto.ERROR
    return response
