Thruway\Peer\Client::__construct PHP Method

__construct() public method

Constructor
public __construct ( string $realm, React\EventLoop\LoopInterface $loop = null )
$realm string
$loop React\EventLoop\LoopInterface
    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");
    }

Usage Example

 function __construct($realm = null)
 {
     if ($realm) {
         $this->realm = $realm;
     }
     parent::__construct($this->realm);
 }
All Usage Examples Of Thruway\Peer\Client::__construct