随笔分类 - 网络编程
摘要:项目描述 TCP协议,客户端和服务端,支持多机 发送和接受文件和图片 发送字符串信息,记录到文本 编译工具,makefile,cmake,检查工具 知识点 抓包工具wireshark,分析数据包 文件IO,读取文件 界面交互式设计,获取参数 网络套接字,网络通信 多线程、多进程,多机通信 变量同步,
阅读全文
摘要:第一版 #include <stdio.h> #include <string.h> #include <errno.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> #include <sys/socket.h> #
阅读全文
摘要:第一版 /* UDP socket server server:socket-->bind-->recvfrom-->sendto-->close */ #include <stdlib.h> #include <stdio.h> #include <sys/socket.h> #include <
阅读全文
摘要:第一版 #include <stdio.h> #include <sys/socket.h> #include <sys/types.h> #include <netinet/in.h> #include <arpa/inet.h> #include <unistd.h> //close() #in
阅读全文
摘要:第一版 #include <stdio.h> #include <sys/types.h> #include <sys/socket.h> // 包含套接字函数库 #include <netinet/in.h> // 包含AF_INET相关结构 #include <arpa/inet.h> // 包
阅读全文
摘要:转换地址格式 inet_ntop() const char *inet_ntop(int family, const void *addrptr, char *strptr, size_t len) { const u_char *p = (const u_char*)addrptr; if (fa
阅读全文
摘要:主要流程 常用TCP函数 TCP:流式套接字 UDP:数据包套接字 套接字建立 socket() 结构体前缀sockaddr_ sockaddr_in结构体 包含的头文件#include <netinet/in.h> socket domain AF_UNIX AF_INET 32地址+16端口 A
阅读全文
摘要:概述 各种协议说明 层结构 TCP/UDP TCP:可靠连接 UDP:不可靠连接 端口 socket端口 socket接口
阅读全文