def request(self, message, timeout=5):
    "\n        Send a request to server and wait util get a response from server or timeout.\n\n        Parameters\n        ----------\n        cmd : str\n            command to control the game. More info can be seen from http://docs.unrealcv.org/en/master/reference/commands.html\n\n        Returns\n        -------\n        str\n            plain text message from server\n\n        Examples\n        --------\n        >>> client = Client('localhost', 9000)\n        >>> client.connect()\n        >>> response = client.request('vget /camera/0/view')\n        "
    if (sys.version_info[0] == 3):
        if (not isinstance(message, bytes)):
            message = message.encode('utf-8')

    def do_request():
        raw_message = (b'%d:%s' % (self.message_id, message))
        _L.debug('Request: %s', raw_message.decode('utf-8'))
        if (not self.message_client.send(raw_message)):
            return None
    if (threading.current_thread().name == self.main_thread.name):
        do_request()
    else:
        self.queue.put(do_request)
    self.wait_response.clear()
    isset = self.wait_response.wait(timeout)
    self.message_id += 1
    assert (isset != None)
    if isset:
        return self.response
    else:
        _L.error('Can not receive a response from server, timeout after %.2f seconds', timeout)
        return None
Send a request to server and wait util get a response from server or timeout.

Parameters
----------
cmd : str
    command to control the game. More info can be seen from http://docs.unrealcv.org/en/master/reference/commands.html

Returns
-------
str
    plain text message from server

Examples
--------
>>> client = Client('localhost', 9000)
>>> client.connect()
>>> response = client.request('vget /camera/0/view')
def request(self, message, timeout=5):
    "\n        Send a request to server and wait util get a response from server or timeout.\n\n        Parameters\n        ----------\n        cmd : str\n            command to control the game. More info can be seen from http://docs.unrealcv.org/en/master/reference/commands.html\n\n        Returns\n        -------\n        str\n            plain text message from server\n\n        Examples\n        --------\n        >>> client = Client('localhost', 9000)\n        >>> client.connect()\n        >>> response = client.request('vget /camera/0/view')\n        "
    if (sys.version_info[0] == 3):
        if (not isinstance(message, bytes)):
            message = message.encode('utf-8')

    def do_request():
        raw_message = (b'%d:%s' % (self.message_id, message))
        _L.debug('Request: %s', raw_message.decode('utf-8'))
        if (not self.message_client.send(raw_message)):
            return None
    if (threading.current_thread().name == self.main_thread.name):
        do_request()
    else:
        self.queue.put(do_request)
    self.wait_response.clear()
    isset = self.wait_response.wait(timeout)
    self.message_id += 1
    assert (isset != None)
    if isset:
        return self.response
    else:
        _L.error('Can not receive a response from server, timeout after %.2f seconds', timeout)
        return None