PHPDaemon\BoundSocket\UDP::enable PHP Метод

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

Enable socket events
public enable ( ) : void
Результат void
    public function enable()
    {
        if ($this->enabled) {
            return;
        }
        if (!$this->fd) {
            return;
        }
        $this->enabled = true;
        if ($this->ev === null) {
            $this->ev = new \Event(Daemon::$process->eventBase, $this->fd, \Event::READ | \Event::PERSIST, [$this, 'onReadUdp']);
            $this->onBound();
        } else {
            $this->onAcceptEv();
        }
        $this->ev->add();
    }