上一页 1 ··· 6 7 8 9 10
摘要: 原理内容同上篇:网络编程 - 西北小蚂蚁 - 博客园 (cnblogs.com)但在上一篇的基础上去掉了延时的限制 有想法不去做妄称少年郎,上一篇提出了回传字符的想法,总感觉不去试一试不好,所以它来了。 一、服务器代码: #include <stdio.h> #include <string.h> 阅读全文
posted @ 2021-07-20 19:21 西北小蚂蚁 阅读(72) 评论(1) 推荐(1) 编辑
摘要: 信号量(线程同步) 头文件 #include <semaphore.h> 信号量的初始化: int sem_init(sem_t *sem, int pshared, unsigned int value); return: 0成功 -1失败 sem_t *sem: 要初始化的信号量 int psh 阅读全文
posted @ 2021-07-20 18:17 西北小蚂蚁 阅读(62) 评论(0) 推荐(1) 编辑
摘要: 内容同上篇:网络编程 - 西北小蚂蚁 - 博客园 (cnblogs.com)但在上一篇的基础上由只能结构体到可以传图片 一、遇到的问题: 不知为何需要加上5ms的延时才可以正常传输,可能是因为发方一直在无脑发,接受方一直在无脑接受,但是速度太快有点匹配不上的原因,不过好在实现了,后面一个思路,发方每 阅读全文
posted @ 2021-07-20 18:04 西北小蚂蚁 阅读(70) 评论(0) 推荐(0) 编辑
摘要: 内容同上篇:网络编程 - 西北小蚂蚁 - 博客园 (cnblogs.com)但在上一篇的基础上由只能传字符型到可以传结构体。 一、服务器代码: #include <stdio.h> #include <string.h> #include <stdlib.h> #include <sys/types 阅读全文
posted @ 2021-07-20 12:55 西北小蚂蚁 阅读(90) 评论(0) 推荐(0) 编辑
摘要: Tcp编程: 头文件: #include <sys/types.h> /* See NOTES */ #include <sys/socket.h> #include <netinet/ip.h> 函数原型: int socket(int domain, int type, int protocol 阅读全文
posted @ 2021-07-18 17:32 西北小蚂蚁 阅读(58) 评论(1) 推荐(0) 编辑
摘要: int pthread_create(pthread_t *tid, const pthread_attr_t *attr, void *(*func) (void *), void *arg); int pthread_join (pthread_t tid, void ** status); p 阅读全文
posted @ 2021-07-18 11:06 西北小蚂蚁 阅读(348) 评论(1) 推荐(0) 编辑
摘要: https://v1.hitokoto.cn/?c=f&encode=text 阅读全文
posted @ 2021-07-18 10:12 西北小蚂蚁 阅读(207) 评论(1) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10