随笔分类 -  socket

摘要:发送端 #include <stdio.h> #include <stdlib.h> #include <unistd.h>// close() #include <string.h>// strcpy, memset(), and memcpy() #include <netdb.h> // st 阅读全文
posted @ 2021-12-31 09:07 roverqqq 阅读(108) 评论(0) 推荐(0) 编辑
摘要:getsockopt #include <stdio.h> #include <stdlib.h> #include <arpa/inet.h> union val { int i_val; long l_val; struct linger linger_val; struct timeval t 阅读全文
posted @ 2021-12-27 17:40 roverqqq 阅读(36) 评论(0) 推荐(0) 编辑
摘要:服务端 #include<stdio.h> #include<sys/types.h> #include<sys/socket.h> #include<netinet/in.h> #include<strings.h> #include<sys/select.h> #include<sys/time 阅读全文
posted @ 2021-12-27 17:38 roverqqq 阅读(68) 评论(0) 推荐(0) 编辑
摘要:服务端 #include <stdio.h> #include <sys/socket.h> #include <sys/types.h> #include <sys/un.h> #define log(fmt,...) printf("%s:%d:"fmt"\n",__func__,__LINE_ 阅读全文
posted @ 2021-12-27 17:37 roverqqq 阅读(198) 评论(0) 推荐(0) 编辑
摘要:服务端 #include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <string.h> #define SERVER_PORT 8888 #define BUF 阅读全文
posted @ 2021-12-27 17:35 roverqqq 阅读(88) 评论(0) 推荐(0) 编辑
摘要:服务端 #include <stdio.h> #include <sys/socket.h> #include <sys/types.h> #include <time.h> #include <errno.h> #include <signal.h> #include <stdlib.h> #in 阅读全文
posted @ 2021-12-27 17:33 roverqqq 阅读(121) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示