1 Star 0 Fork 0

prookie01/个人播客web服务器

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
webServer.h 897 Bytes
一键复制 编辑 原始数据 按行查看 历史
prookie01 提交于 2023-05-15 13:40 . webServer简单的实现文件
#pragma once
#include<stdio.h>
#include<arpa/inet.h>
#include<string.h>
#include<unistd.h>
#include<stdlib.h>
#include<sys/socket.h>
#include<sys/types.h>
#include<sys/epoll.h>
#include<sys/stat.h>
#include<errno.h>
#include<time.h>
#include<fcntl.h>
#include"fileType.h"
#include"setAddr.h"
#include"hashAddr.h"
#define EPOLLSIZE 1024
//服务器主要流程
void webServer(mAddrs *addr);
//读取客户端请求
void readClientRequset(struct epoll_event *ev,int epfd);
//发送头
void sendHand(int fd,int code,char *info,char *fileType,int length);
//发送文件
void sendFile(int cfd,char *path);
//读取一行
ssize_t readLine(int fd,void *vptr,ssize_t maxlen);
int setNoBlock(int fd);
void printNowTime(const char *str);
//关闭链接并下树
void closeConn(int epfd,struct epoll_event *ev);
void printInfo(hashAddr *hash,int fd);
//
void dameonPid(void);
int cutStdout(void);
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/prookie01/personal-podcast-web-server.git
git@gitee.com:prookie01/personal-podcast-web-server.git
prookie01
personal-podcast-web-server
个人播客web服务器
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385