Kraken\Channel\Model\Socket\Connection\ConnectionPool::existsConnection PHP Метод

existsConnection() публичный Метод

public existsConnection ( string $id ) : boolean
$id string
Результат boolean
    public function existsConnection($id)
    {
        return isset($this->connectionPool[$id]);
    }

Usage Example

Пример #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;
 }