1 Star 0 Fork 0

trff/MyTinyWebserver

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.cpp 706 Bytes
一键复制 编辑 原始数据 按行查看 历史
trff 提交于 2024-08-29 01:15 . 主函数
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/epoll.h>
#include <signal.h>
#include "locker.h"
#include "threadpool.h"
using namespace std;
//添加信号捕获
void addsig(int sig,void(handler)(int))
{
struct sigaction sa;
memset(&sa,0,sizeof(sa));
sa.sa_handler = handler;
sigfillset(&sa.sa_mask);
sigaction(sig,&sa,NULL);
}
int main(int argc, char* argv[])
{
if(argc <= 1)
{
cout<<"User "<<basename(argv[0])<<" <PORT>"<<endl;
exit(-1);
}
//获取端口号
int port = atoi(argv[1]);
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/trff/MyTinyWebserver.git
git@gitee.com:trff/MyTinyWebserver.git
trff
MyTinyWebserver
MyTinyWebserver
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385