Inheritance: extends Kraken\Event\EventEmitterInterface, extends Kraken\Loop\LoopResourceInterface, extends Kraken\Stream\StreamBaseInterface
示例#1
0
 /**
  * @param string $id
  * @param string $data
  * @return bool
  */
 private function writeData($id, $data)
 {
     if ($this->socket === null) {
         return false;
     }
     try {
         if ($this->type === Channel::CONNECTOR) {
             return $this->socket->write($data);
         }
         if ($this->type === Channel::BINDER && $this->connectionPool->existsConnection($id)) {
             return $this->connectionPool->getConnection($id)->getSocket()->write($data);
         }
     } catch (Error $ex) {
         return false;
     } catch (Exception $ex) {
         return false;
     }
     return false;
 }
示例#2
0
 /**
  * @override
  * @inheritDoc
  */
 public function stop()
 {
     $this->socket->close();
 }
示例#3
0
 /**
  * @override
  * @inheritDoc
  */
 public function resume()
 {
     $this->listener->resume();
 }