protected function listenSocket(): Generator
    {
        yield Dispatcher::listenRead($this->server);
        $handle = fopen($this->locker, 'a');

        if ($handle && flock($handle, LOCK_EX)) {
            yield Dispatcher::async($this->acceptSocket());
            flock($handle, LOCK_UN);
        }

        fclose($handle);
        yield Dispatcher::async($this->listenSocket());
    }