嵌入式培训机构四个月实训课程笔记(完整版)-Linux网络编程第二天-tcp编程练习(物联技术666)

点赞+关注,功德无量。更多配套资料,欢迎私信。
网盘链接:百度网盘 请输入提取码
 

WebServer编程:

--------------------------------------

#include <stdio.h>

#include <stdlib.h>

#include <string.h>                                    

#include <unistd.h>

#include <sys/socket.h>

#include <netinet/in.h>

#include <arpa/inet.h>                               

#include <pthread.h>

#include <sys/types.h>

#include <sys/stat.h>

#include <fcntl.h>

void *Client_Process(void *arg)

{

       char recvbuf[2048] = "";                              // 接收缓冲区

       char httpbuf[200]="";

       char http_path[200]="";

       int fd,send_num=0;

       char buf_send[1024]="";

      

       char head[]="HTTP/1.1 200 OK\r\n"\

                          "Content-Type: text/html\r\n"\

                          "\r\n";   

       char err[]=   "HTTP/1.1 404 Not Found\r\n"          \

                          "Content

相关推荐

最近更新

  1. TCP协议是安全的吗?

    2024-01-13 19:30:05       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-01-13 19:30:05       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-01-13 19:30:05       19 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-01-13 19:30:05       20 阅读

热门阅读

  1. QT 应用程序在 Windows 系统上出现中文乱码

    2024-01-13 19:30:05       35 阅读
  2. 【SPDK】【NoF】使用SPDK部署NVMe over TCP

    2024-01-13 19:30:05       32 阅读
  3. js join方法的使用

    2024-01-13 19:30:05       43 阅读
  4. 【算法笔记】分治专题

    2024-01-13 19:30:05       32 阅读
  5. 【JVM之再阅读】

    2024-01-13 19:30:05       37 阅读
  6. Go语言中的同步原语:ErrGroup、Semaphore和SingleFlight

    2024-01-13 19:30:05       37 阅读
  7. 网络设备远程运维管理解决方案

    2024-01-13 19:30:05       39 阅读
  8. ReactHooks:useEffect使用指南

    2024-01-13 19:30:05       45 阅读
  9. Vue的响应式编程

    2024-01-13 19:30:05       43 阅读
  10. Driver.js使用指南

    2024-01-13 19:30:05       38 阅读
  11. TypeScript基础知识:类型守卫和类型推断

    2024-01-13 19:30:05       37 阅读