PHPDaemon\BoundSocket\Generic::enable PHP Method

enable() public method

Enable socket events
public enable ( ) : void
return void
    public function enable()
    {
        if ($this->enabled) {
            return;
        }
        if (!$this->fd) {
            return;
        }
        $this->enabled = true;
        if ($this->ev === null) {
            if ($this->eventLoop === null) {
                $this->eventLoop = EventLoop::$instance;
            }
            $this->ev = $this->eventLoop->listener([$this, 'onAcceptEv'], null, \EventListener::OPT_CLOSE_ON_FREE | \EventListener::OPT_REUSEABLE, -1, $this->fd);
            $this->onBound();
        } else {
            $this->ev->enable();
        }
    }