public function __construct($realm, LoopInterface $loop = null)
{
Utils::checkPrecision();
$this->realm = $realm;
$this->loop = $loop ? $loop : Factory::create();
$this->transportProvider = null;
$this->roles = [];
$this->authMethods = [];
$this->session = null;
$this->clientAuthenticators = [];
$this->authId = "anonymous";
$this->reconnectOptions = ["max_retries" => 15, "initial_retry_delay" => 1.5, "max_retry_delay" => 300, "retry_delay_growth" => 1.5, "retry_delay_jitter" => 0.1];
$this->on('open', [$this, 'onSessionStart']);
Logger::info($this, "New client created");
}