src/Leevel/Protocol/Server.php
protected function eventServer(): void
    {
        $type = get_class($this);
        $type = substr($type, strrpos($type, '\\') + 1);
        $type = str_replace('Server', '', $type);

        foreach ($this->serverEvent as $event) {
            if (!method_exists($this, $onEvent = 'on'.$type.ucfirst($event))) {
                $onEvent = 'on'.ucfirst($event);
            }

            $this->server->on($event, [$this, $onEvent]);
        }
    }
protected function eventServer(): void
    {
        $type = get_class($this);
        $type = substr($type, strrpos($type, '\\') + 1);
        $type = str_replace('Server', '', $type);

        foreach ($this->serverEvent as $event) {
            if (!method_exists($this, $onEvent = 'on'.$type.ucfirst($event))) {
                $onEvent = 'on'.ucfirst($event);
            }

            $this->server->on($event, [$this, $onEvent]);
        }
    }
http server 绑定事件.