Icicle\Loop\Manager\Select\SelectIoManager::listen PHP Method

listen() public method

public listen ( Io $io, float $timeout )
$io Io
$timeout float
    public function listen(Io $io, float $timeout = 0)
    {
        $resource = $io->getResource();
        $id = (int) $resource;
        if (!isset($this->sockets[$id]) || $io !== $this->sockets[$id]) {
            throw new FreedError();
        }
        $this->pending[$id] = $resource;
        if (isset($this->timers[$id])) {
            $this->timers[$id]->stop();
        }
        if ($timeout) {
            if (self::MIN_TIMEOUT > $timeout) {
                $timeout = self::MIN_TIMEOUT;
            }
            $this->timers[$id] = $this->loop->timer($timeout, false, $this->timerCallback, $io);
        }
    }