摘要: #include <sys/socket.h>#include <netdb.h>#include <unistd.h>#include <string.h>#include <stdlib.h>#include <stdio.h>#include <signal.h>#include <memor 阅读全文
posted @ 2017-03-05 21:11 lvdh1314 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 广播实现一对多的通信,通过向广播地址发送数据报文实现 只有udp的程序才能广播,tcp不能 #include <sys/socket.h>#include <netdb.h>#include <unistd.h>#include <string.h>#include <stdlib.h>#inclu 阅读全文
posted @ 2017-03-05 21:01 lvdh1314 阅读(146) 评论(0) 推荐(0) 编辑
摘要: #include <sys/socket.h>#include <netdb.h>#include <unistd.h>#include <string.h>#include <stdlib.h>#include <stdio.h>#include <signal.h>#include <memor 阅读全文
posted @ 2017-03-05 20:31 lvdh1314 阅读(1157) 评论(0) 推荐(0) 编辑
摘要: 在/etc/hosts中已经设置了ip与域名的映射关系,通过域名解析函数进行解析(主机名,别名,协议类型,网络地址大小,指向网络IP地址指针等) 部分解析函数: #include<netdb.h> struct hostent gethostbyname(const char *hostname); 阅读全文
posted @ 2017-03-05 20:17 lvdh1314 阅读(149) 评论(0) 推荐(0) 编辑
摘要: #include <sys/socket.h>#include <netdb.h>#include <unistd.h>#include <string.h>#include <stdlib.h>#include <stdio.h>#include <signal.h>#include <memor 阅读全文
posted @ 2017-03-05 10:21 lvdh1314 阅读(201) 评论(0) 推荐(0) 编辑
摘要: #include <sys/socket.h>#include <netdb.h>#include <unistd.h>#include <string.h>#include <stdlib.h>#include <stdio.h>#include <signal.h>#include <time. 阅读全文
posted @ 2017-03-05 10:03 lvdh1314 阅读(239) 评论(0) 推荐(0) 编辑