protected function afterHandshake($socket): Generator
    {
        Logger::log('worker', $this->pid, 'connection accepted for', (int)$socket);
        $this->clients[(int)$socket] = $socket;
        yield Dispatcher::async($this->onConnect($socket));
        yield Dispatcher::async($this->read($socket));
    }