Chinaunix首页 | 论坛 | 博客
  • 博客访问: 37738
  • 博文数量: 41
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 357
  • 用 户 组: 普通用户
  • 注册时间: 2014-04-20 16:26
文章分类

全部博文(41)

文章存档

2014年(41)

我的朋友

发布时间:2014-04-26 13:20:51

HTTP(HyperTextTransferProtocol)是超文本传输协议的缩写,它用于传送WWW方式的数据,浏览器与Web服务器之间所遵循的协议就是HTTP,关于HTTP协议的详细内容请参考RFC2616。HTTP协议采用了请求/响应模型。客户端向服务器发送一个请求,请求头包含请求的方法、URI、协议版本、以及包含请求修饰符、客户信息和内容的类似于MIM.........【阅读全文】

阅读(213) | 评论(0) | 转发(0)

发布时间:2014-04-24 23:39:14

与刺激的abort()和exit()相比,goto语句看起来是处理异常的更可行方案。不幸的是,goto是本地的:它只能跳到所在函数内部的标号上,而不能将控制权转移到所在程序的任意地点(当然,除非你的所有代码都在main体中)。为了解决这个限制,C函数库提供了setjmp()和longjmp()函数,它们分别承担非局部标号和goto作用。头文.........【阅读全文】

阅读(166) | 评论(0) | 转发(0)

发布时间:2014-04-23 22:01:29

获取时间:#include <stdio.h>#include <time.h>int main(){    time_t t;    struct tm *lt;    t = time(NULL);//获取秒数计的时间//time(&t)    lt = localtime(&t);//获取本地时间    printf("local time:%d/%d/%d.........【阅读全文】

阅读(204) | 评论(0) | 转发(0)

发布时间:2014-04-23 21:21:44

client:#include <stdio.h>#include <sys/stat.h>#include <stdlib.h>#include <unistd.h>#include <errno.h>#include <string.h>#include <sys/types.h>#include <sys/socket.h>#include<netinet/in.h>int main(){    int opt = 1;    socklen_t len = sizeof(len);&nbs.........【阅读全文】

阅读(157) | 评论(0) | 转发(0)

发布时间:2014-04-23 21:14:39

一个select函数的例子#include <stdio.h>#include <time.h>#include <sys/types.h>#include <unistd.h>#include <fcntl.h>int main(){    struct timeval tv;    char buf[100] = "pig";    fd_set readfds;    tv.tv_sec = 4;  &nbs.........【阅读全文】

阅读(205) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册