会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
药剂学徒
Powered by
博客园
博客园
|
首页
|
新随笔
|
联系
|
订阅
|
管理
上一页
1
2
3
4
5
6
···
18
下一页
2018年5月23日
select服务器模型
摘要: 服务端 客户端
阅读全文
posted @ 2018-05-23 22:26 药剂学徒
阅读(233)
评论(0)
推荐(0)
2018年5月20日
网络编程-并发服务器基础
摘要: #include #include #include #include #include #include #include #define port 8000 //#include #include int main(int argc,char * argv[]){ int lfd,cfd,len,i; char buf[1024]; struct sockaddr_in server...
阅读全文
posted @ 2018-05-20 21:58 药剂学徒
阅读(147)
评论(0)
推荐(0)
2018年5月19日
生产者消费者模型
摘要: 互斥锁,条件变量实现:1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 //#include 10 #include 11 #include...
阅读全文
posted @ 2018-05-19 21:18 药剂学徒
阅读(154)
评论(0)
推荐(0)
2018年5月5日
readv()和write()sendfile()
摘要: readv函数将文件描述符读取到分散的内存存快中,分散读,writev把分散的数据一并写入文件描述符中,集中写。 ssize_t readv(int fd,const struct iovec* vector,int count); ssize_t writev(int fd,const struc
阅读全文
posted @ 2018-05-05 10:58 药剂学徒
阅读(843)
评论(0)
推荐(0)
2018年5月4日
snprintf函数的用法
摘要: int snprintf(char *restrict buf, size_t n, const char * restrict format, ...); 函数说明:最多从源串中拷贝n-1个字符到目标串中,然后再在后面加一个0。所以如果目标串的大小为n 的话,将不会溢出。 函数返回值:若成功则返回
阅读全文
posted @ 2018-05-04 23:49 药剂学徒
阅读(2235)
评论(0)
推荐(0)
struct stat结构体的简介
摘要: 在使用这个结构体和方法时,需要引入: <sys/types.h> <sys/stat.h> struct stat这个结构体是用来描述一个linux系统文件系统中的文件属性的结构。 可以有两种方法来获取一个文件的属性: 1、通过路径: int stat(const char *path, struc
阅读全文
posted @ 2018-05-04 23:16 药剂学徒
阅读(191)
评论(0)
推荐(0)
2018年5月2日
half-socket
摘要: client: server:
阅读全文
posted @ 2018-05-02 18:41 药剂学徒
阅读(209)
评论(0)
推荐(0)
结构体struct sockaddr_in, struct sockaddr,struct in_addr
摘要: 一、结构体 struct sockaddr_in, struct sockaddr, struct in_addr struct sockaddr_in, struct sockaddr,struct in_addr,这是网络编程中常用的结构体,每次都记不住它们各自的成员是啥,需要临时查,为方便以后
阅读全文
posted @ 2018-05-02 16:54 药剂学徒
阅读(1066)
评论(0)
推荐(0)
int main(int argc,char* argv[])的作用
摘要: main(int argc,char* argv[]):argc表示文件运行时候,以空格为单位的所有参数的个数。argv[]数组一次存放所有字符串。 比如: test one two three<回车> argc = 3,从0-3,argv[0] = test,argv[1]=one,argv[2]
阅读全文
posted @ 2018-05-02 16:25 药剂学徒
阅读(275)
评论(0)
推荐(0)
2018年5月1日
fgets和fputs,fread和fwrite,fscanf,和fprintf用法小结
摘要: 一、fgets(str,n,fp); fgets(str,n,fp);就是从fp指向的文件中读取n-1个字符送入字符数组str中。 说明:1、在读出n-1个字符之前,如果遇到了换行符或者EOF,则读出结束。 2、fgets函数也有返回值,其返回值是字符数组的首地址。 二、fputs("abcd",f
阅读全文
posted @ 2018-05-01 23:41 药剂学徒
阅读(766)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
···
18
下一页