'Send a command to the server.
Parameters
command : str
The command to send.
Returns
resp : str
The response from the server.'

def _send_command(self, command):

    logger.debug(('Sending    command:    %s' % command))
    command += '\n'
    self._cmd_sock.sendall(command.encode('utf-8'))
    (buf, chunk, begin) = ([], '', time.time())
    while True:
        if (buf and ((time.time() - begin) > self._timeout)):
            break
        elif ((time.time() - begin) > (self._timeout * 2)):
            break
        try:
            chunk = self._cmd_sock.recv(8192)
            if chunk:
                buf.append(chunk)
                begin = time.time()
            else:
                time.sleep(0.1)
        except:
            pass
    return ''.join(buf)
