Beispiel #1
0
 public function disconnect()
 {
     parent::disconnect();
     $this->connected = false;
 }
Beispiel #2
0
 /**
  * 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
 }