![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
socket网络通信
socket
Zhang-Zhen
工作记录●升级打怪
展开
-
udp C语言编程
#include <stdio.h>#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <string.h> #define SERVER_PORT 8888#define BUFF_LEN 1024 void handle_udp_msg(int fd){ char buf[BUFF_LEN]; //接收缓冲区,10原创 2021-04-05 21:01:45 · 106 阅读 · 0 评论 -
TCP socket 编程示例
本代码为老师提供的示例程序一、TCP socket 编程模型二、使用TCP协议实现一个简单的通讯程序1.服务器端#include<stdlib.h>#include<stdio.h>#include<sys/socket.h>#include<netdb.h>#include<string.h>#include<unistd.h>#include<netinet/in.h>#include<ar原创 2021-04-05 20:24:28 · 407 阅读 · 0 评论