'Sent a management command to the current ZK server.
Examples are `ruok`, `envi` or `stat`.
:returns: An unstructured textual response.
:rtype: str
:raises:
:exc:`ConnectionLoss` if there is no connection open, or
possibly a :exc:`socket.error` if there\'s a problem with
the connection used just for this command.
.. versionadded:: 0.5'

def command(self, cmd='ruok'):

    if (not self._live.is_set()):
        raise ConnectionLoss('No    connection    to    server')
    peer = self._connection._socket.getpeername()
    sock = self.handler.create_connection(peer, timeout=(self._session_timeout / 1000.0))
    sock.sendall(cmd)
    result = sock.recv(8192)
    sock.close()
    return result.decode('utf-8', 'replace')
