markparticle / WebServer

C++ Linux WebServer服务器
Apache License 2.0
3.58k stars 733 forks source link

浏览器访问的端口号是多少? #81

Open zhang123-sys opened 1 year ago

y-Adrian commented 1 year ago

使用命令ps -ef|grep ./server获取进程 ID 之后,再执行命令netstat -nap | grep 进程ID,即可看到进程监听的端口号。 main 函数中也有指定端口:

WebServer server(
        1316, 3, 60000, false,             /* 端口 ET模式 timeoutMs 优雅退出  */
        3306, "root", "root", "webserver", /* Mysql配置 */
        12, 6, true, 1, 1024);             /* 连接池数量 线程池数量 日志开关 日志等级 日志异步队列容量 */

这里的1316就是端口号。

zhang123-sys commented 1 year ago

谢谢,用您说的端口号访问时,登录和注册有bug

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2023年4月6日(星期四) 凌晨0:08 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [markparticle/WebServer] 浏览器访问的端口号是多少? (Issue #81)

使用命令ps -ef|grep ./server获取进程 ID 之后,再执行命令netstat -nap | grep 进程ID,即可看进程监听的端口号。 main 函数中也有指定端口: WebServer server( 1316, 3, 60000, false, / 端口 ET模式 timeoutMs 优雅退出 / 3306, "root", "root", "webserver", / Mysql配置 / 12, 6, true, 1, 1024); / 连接池数量 线程池数量 日志开关 日志等级 日志异步队列容量 /

这里的1316就是端口号。

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

y-Adrian commented 1 year ago

@zhang123-sys 我这边试了试,也是这样,生成好像是生成了一个空的SQL导致程序宕掉了,目前还不知道怎么解决。

server: ../code/http/httprequest.cpp:182: static bool HttpRequest::UserVerify(const string&, const string&, bool): Assertion `sql' failed.
Ephmeral commented 1 year ago

@zhang123-sys 我这边试了试,也是这样,生成好像是生成了一个空的SQL导致程序宕掉了,目前还不知道怎么解决。

server: ../code/http/httprequest.cpp:182: static bool HttpRequest::UserVerify(const string&, const string&, bool): Assertion `sql' failed.

我也发现同样的报错,然后看了下应该是我的数据库没连接上,在main函数修改对应参数之后就好了

buxiugangpener commented 9 months ago

b8cfef99f75a4e6510ad04d5c0ccd8b main文件中,数据库名称以及密码已经更改。 点击登录或者注册的时候,还是Assertion `sql' failed.求大佬救救我。困惑两天了。 环境:centos7/g++8/mysql8