自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(10)
  • 问答 (2)
  • 收藏
  • 关注

原创 c++入门 (成员变量)<四>

Fields,parameters local variables.                 1. All three kinds of variable are able to store a value that is appropriate to their defined type. 这三种类型都可以存储一个指定类型的值 2. Fields are defined outsi

2017-03-29 15:19:23 303

翻译 c++入门 (头文件)<三>

Definition of a class      类的定义 1. In C++,seperated .h and .cpp file are used to define on class.  C++用.h 和 .cpp文件来分别定义类 2. Class declaration and prototypes in that class are in the header file.(.h)

2017-03-29 14:13:54 311

原创 c++入门 (什么是面向对象编程,理论)<二>

oop的原则 1. 对象是data + operation.  外部对象不能直接访问对象的data,可以调用对象的operation. 2. 对象是Entity, is an variable in programing language. 3. 面向对象 is a way to designs and implements.  Objects not control and not dat

2017-03-29 11:34:48 284

原创 c++入门 (Hello world)<一>

第一个C++程序,Hello world #include using namespace std; int main() { cout return 0; } 这里和C的区别是#include ,C里面头文件都是.h结尾,这里没有; 有一个典故,在iostream这个lib出现之前已经有了iostream.h这个lib,为了和iostrea

2017-03-29 11:13:21 617

原创 Tinyhttpd源码学习(httpd.c)<六>

当httpd运行时,对文件具有可执行权限时,则认为该文件是cgi程序,调用函数 execute_cgi /**********************************************************************/ /* Execute a CGI script.  Will need to set environment variables as

2017-03-28 15:53:56 326

原创 Tinyhttpd源码学习(httpd.c)<五>

接着上面,当path的本地文件没有可执行权限时,认为不是cgi程序,调用serve_file进行处理 void serve_file(int client, const char *filename) {     FILE *resource = NULL; //---------------  声明FILE     int numchars = 1;     char buf

2017-03-28 14:50:32 303

原创 Tinyhttpd源码学习(httpd.c)<四>

写完startup,下一个就是accept_request,这里是处理请求的主要逻辑 void accept_request(void *arg) {     int client = (intptr_t)arg; //----------------------  client_sock的fd     char buf[1024]; //-------------------

2017-03-28 12:02:02 300

原创 Tinyhttpd源码学习(httpd.c)<三>

继续上一篇,写startup方法,服务端socket的启动过程 int startup(u_short *port) {     int httpd = 0; //-------------- server_sock的fd声明     int on = 1;     struct sockaddr_in name; //------------- 服务器地址的数据结构IP

2017-03-28 11:50:00 333

原创 Tinyhttpd源码学习(httpd.c)<二>

因为代码有500行,相对较长,这里不再按照源代码的顺序,而是按照调用关系,先main,后一个个方法展开 int main(void) {     int server_sock = -1; //----------该httpd的服务socket的fd ,声明     u_short port = 4000; //---------- 默认端口 4000     int client_

2017-03-28 11:47:27 292

原创 Tinyhttpd源码学习(simpleclient.c)<一>

这是我学习c/c++的第二个项目,做为一个菜鸟,只会最基本的语法,很多都要标记出来。

2017-03-28 11:07:15 477

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除