上一页 1 ··· 11 12 13 14 15
摘要: 头文件:md5.h 1 #ifndef MD5_H 2 #define MD5_H 3 4 typedef struct 5 { 6 unsigned int count[2]; 7 unsigned int state[4]; 8 unsigned char buffer[64]; 9 }MD5_ 阅读全文
posted @ 2020-01-05 19:14 嗷嗷鹿鸣[VX|dshoub] 阅读(2637) 评论(0) 推荐(0)
摘要: 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <unistd.h> 4 #include <string.h> 5 #define MAXBUFSIZE 1024 6 #define WAIT_SECOND 3 //暂停时间,单位为“秒” 阅读全文
posted @ 2019-12-31 19:25 嗷嗷鹿鸣[VX|dshoub] 阅读(1295) 评论(0) 推荐(0)
摘要: 重点:accept后fork,子进程和父进程共享两个fd,一个是 监听fd,一个是客户端socketfd,。 子进程需要关闭监听套接字fd,父进程需要关闭客户端套接字fd进行继续accept. 这样子进程就可以对客户端进行读写了。 服务器代码.c #include<sys/types.h> #inc 阅读全文
posted @ 2019-12-31 19:06 嗷嗷鹿鸣[VX|dshoub] 阅读(590) 评论(0) 推荐(0)
上一页 1 ··· 11 12 13 14 15