摘要: 多线程实现NTP服务器 服务器端:server.c #include <stdio.h>#include <stdlib.h>#include <string.h>#include <arpa/inet.h>#include <sys/types.h>#include <sys/socket.h># 阅读全文
posted @ 2022-08-10 11:32 *^VV^* 阅读(75) 评论(0) 推荐(0)
摘要: 多进程实现NTP服务器 服务器端:server.c #include <stdio.h>#include <stdlib.h>#include <string.h>#include <arpa/inet.h>#include <sys/types.h>#include <sys/socket.h># 阅读全文
posted @ 2022-08-10 11:26 *^VV^* 阅读(37) 评论(0) 推荐(0)
摘要: 通过TCP实现NTP服务器 头文件:proto.h #ifndef __PRTOO_H__#define __PRTOO_H__ #define PORT "8888" //服务器端口#define FMT "%lld\r\n" //输出格式 #endif 服务器端:server.c #includ 阅读全文
posted @ 2022-08-10 11:17 *^VV^* 阅读(358) 评论(0) 推荐(0)
摘要: 通过UDP实现局域网多播、组播 头文件:proto.h #ifndef __PROTO_H__#define __PROTO_H__ #define BORDCAST "224.2.2.2" //定义组播IP地址#define PORT "10001" //组播端口#define NAMESIZE 阅读全文
posted @ 2022-08-10 08:39 *^VV^* 阅读(626) 评论(0) 推荐(0)