示例#1
0
 /**
  * @param ClientSession $session
  */
 public function startSession(ClientSession $session)
 {
     $details = ["roles" => ["publisher" => new \stdClass(), "subscriber" => new \stdClass(), "caller" => new \stdClass(), "callee" => new \stdClass()]];
     /** @var ClientAuthenticationInterface $ca */
     foreach ($this->clientAuthenticators as $ca) {
         $this->authMethods = array_merge($this->authMethods, $ca->getAuthMethods());
     }
     $details["authmethods"] = $this->authMethods;
     $details["authid"] = $this->authId;
     $this->addRole(new Callee($this->getLogger()))->addRole(new Caller())->addRole(new Publisher())->addRole(new Subscriber());
     $session->setRealm($this->realm);
     $session->sendMessage(new HelloMessage($session->getRealm(), $details, array()));
 }
示例#2
0
文件: Client.php 项目: voryx/thruway
 /**
  * Start client session
  *
  * @param \Thruway\ClientSession $session
  */
 public function startSession(ClientSession $session)
 {
     $this->addRole(new Callee())->addRole(new Caller())->addRole(new Publisher())->addRole(new Subscriber());
     $details = (object) ["roles" => $this->getRoleInfoObject()];
     $details->authmethods = $this->authMethods;
     $details->authid = $this->authId;
     $session->setRealm($this->realm);
     $session->sendMessage(new HelloMessage($session->getRealm(), $details));
 }
示例#3
0
 /**
  * Start client session
  *
  * @param \Thruway\ClientSession $session
  */
 public function startSession(ClientSession $session)
 {
     $details = ["roles" => ["publisher" => new \stdClass(), "subscriber" => new \stdClass(), "caller" => new \stdClass(), "callee" => new \stdClass()]];
     $details["authmethods"] = $this->authMethods;
     $details["authid"] = $this->authId;
     $this->addRole(new Callee())->addRole(new Caller())->addRole(new Publisher())->addRole(new Subscriber());
     $session->setRealm($this->realm);
     $session->sendMessage(new HelloMessage($session->getRealm(), $details, []));
 }