src/Leevel/Protocol/Console/Base/Server.php
protected function checkPort(array $option): void
    {
        $bind = $this->portBind(
            (int) ($option['port'])
        );

        if ($bind) {
            foreach ($bind as $k => $val) {
                if ('*' === $val['ip'] || $val['ip'] === $option['host']) {
                    throw new InvalidArgumentException(
                        sprintf(
                            'The port has been used %s:%s,the port process ID is %s',
                            $val['ip'], $val['port'], $k
                        )
                    );
                }
            }
        }
    }
protected function checkPort(array $option): void
    {
        $bind = $this->portBind(
            (int) ($option['port'])
        );

        if ($bind) {
            foreach ($bind as $k => $val) {
                if ('*' === $val['ip'] || $val['ip'] === $option['host']) {
                    throw new InvalidArgumentException(
                        sprintf(
                            'The port has been used %s:%s,the port process ID is %s',
                            $val['ip'], $val['port'], $k
                        )
                    );
                }
            }
        }
    }
验证端口是否被占用.

@param array $option