完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
我写了一个基于SOCKET HTTP请求的小程序,但是为什么我的程序只能执行一次HTTP强求,当我刷新连接网址时程序就报段错误崩溃了。一个简单的HTTP服务器程序。#include #include #include #include #define BUF_LEN 512 #define SERVER_PORT 8080 const static char http_error_hdr[] = "HTTP/1.1 404 Not FoundrnContent-type: text/htmlrnrn"; const static char http_html_hdr[] = "HTTP/1.1 200 OKrnContent-type: text/htmlrnrn"; const static char http_index_html[] = " " Welcome to our HTTP server demo!"" This is a just small test page."; |