예제 #1
0
 public function receive()
 {
     $this->checkConnection();
     Debug_Profiler::__do("receive");
     $rcvd = "";
     $rcvd = fread($this->socket, 4096);
     Debug_Profiler::__do("received: " . htmlentities($rcvd));
     $this->serverStream[$this->messageId++] = $rcvd;
     if (strlen($rcvd) > 0) {
         return $rcvd;
     } else {
         return false;
     }
 }
예제 #2
0
 public function __construct($host, $port, $realm, $username, $password, $digestURI)
 {
     $this->socket = new Socket_Client($host, $port);
     Debug_Profiler::__do("connectionEstablished");
     $this->realm = $realm;
     $this->handshake();
     Debug_Profiler::__do("handshakeComplete. connID={$this->connectionId}");
     $this->authenticate($username, $password, $digestURI);
     if (!$this->isAuthenticated()) {
         throw new Exception("Authentication failed");
     }
     Debug_Profiler::__do("authed ok");
     $this->bindService();
     Debug_Profiler::__do("service bound");
 }