コード例 #1
0
ファイル: Peer.php プロジェクト: maestroprog/esockets-php
 public function disconnect()
 {
     parent::disconnect();
     $this->connected = false;
 }
コード例 #2
0
ファイル: Server.php プロジェクト: maestroprog/esockets-php
 /**
  * close server
  */
 public function disconnectAll()
 {
     foreach ($this->connections as $index => $peer) {
         /**
          * @var $peer \Esockets\Peer
          */
         $peer->disconnect();
         unset($this->connections[$index], $peer);
     }
     if ($this->socket_domain === AF_UNIX) {
         if (file_exists($this->socket_address)) {
             unlink($this->socket_address);
         } else {
             trigger_error(sprintf('Pipe file "%s" not found', $this->socket_address));
         }
     }
     if ($this->opened) {
         parent::disconnect();
     }
     $this->opened = false;
     // /@TODO recheck this code
 }