示例#1
0
 /**
  * @return bool
  */
 private function stopConnection()
 {
     if ($this->socket === null) {
         return false;
     }
     $socket = null;
     $ex = null;
     try {
         switch ($this->type) {
             case Channel::CONNECTOR:
                 $this->destroyConnector();
                 break;
             case Channel::BINDER:
                 $this->destroyBinder();
                 break;
             default:
                 return false;
         }
     } catch (Error $ex) {
     } catch (Exception $ex) {
     }
     if ($ex !== null) {
         return false;
     }
     $this->socket->close();
     unset($this->socket);
     $this->socket = null;
     return true;
 }
示例#2
0
 /**
  * @override
  * @inheritDoc
  */
 public function stop()
 {
     $this->socket->close();
 }
示例#3
0
 /**
  * @override
  * @inheritDoc
  */
 public function close()
 {
     $this->listener->close();
 }