文本文件读写


实例功能概述 文本文件是指以以纯文本格式存储的文件,例如用 Qt Creator 编写的 C++ 程序的头文件和源文件。HTML 和 XML 文件也是纯文本文件,只是读取之后需要对内容进行解析之后再显示。 Qt 提供了两种读写纯文本文件的基本方法,一种是用 QFile类的 QIODevice读写功能

Qt窗口滑动效果


GPT 示例代码 主窗口滑动 #include <QApplication> #include <QMainWindow> #include <QPropertyAnimation> class MainWindow : public QMainWindow { Q_OBJECT pub

设置exe图标


在 pro 文件中设置如下: RC_ICONS = main.ico main.ico 放在当前目录下

11.UDP Posix 3


UDP Server /* * 函数名称: udp_server_entry * 作 者: 黄彦杰 Lenn * 设计日期: 2024-07-26 * 功能描述: udp server * 返 回 值: 成功返回0,失败返回-1 */ static int udp_server_e

12.UDP Posix 4


今天的任务就是把这个代码调通,这个代码量上来之后,调代码真是个痛苦的过程。 Debug 看一下网卡信息 加几个打印看看

15.UDP Control Block


结构体 tcp控制块 // tcp control block typedef struct __ln_tcp_stream { int fd; uint32_t sip; uint32_t dip; uint16_t sport; uint16_t d

14.进程间通信组件架构设计


Linux进程通信方式 管道:创建的时候分配一个页大小内存,空间有限,不适合大量数据传输。 消息队列:有两次copy造成额外的CPU消耗,不适合大量信息传输,效率比较低。 共享内存:多个进程共享一块内存,没有同步机制,需要自己实现同步机制。 套接字:在单机的情况下面走网络传输效率低。 信号量:是一种

13.Unix TCP


tcp server #include <stdio.h> #include <arpa/inet.h> #include <sys/socket.h> #include <netinet/in.h> #include <sys/types.h> #include <string.h> int m

16.TCP Control Block Bebug 1


随着代码量增加和逻辑的复杂度提高,需要专门debug一下,很难一次就写对。 编译 Makefile # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2010-2014 Intel Corporation # binary name AP

17.TCP Server Status Transmission


组织tcp数据包 /* * 函数名称: ln_tcp_encode * 作 者: 黄彦杰 Lenn * 设计日期: 2024-08-02 * 功能描述: 组织tcp数据包 * 返 回 值: 0 */ static int ln_tcp_encode(uint8_t* pktbuf,