mirror of
https://gitee.com/jiuyilian/embedded-framework.git
synced 2025-01-06 10:16:51 -05:00
add readme.md
This commit is contained in:
parent
8d10ca43a1
commit
eb49a6af0a
|
@ -16,7 +16,7 @@
|
|||
#define TCP_MODULE_H
|
||||
#include <stddef.h>
|
||||
#include <sys/types.h>
|
||||
#define TCP_MODULE_WRITE_ERROR -1;
|
||||
#define TCP_MODULE_WRITE_ERROR -1
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -30,8 +30,8 @@ typedef struct client_accept_parm
|
|||
} ClientAcceptParam;
|
||||
typedef struct tcp_server_parm
|
||||
{
|
||||
const char *mIp;
|
||||
const int mPort;
|
||||
const char *mIp; /**Server ip */
|
||||
const int mPort; /**Server port */
|
||||
const TcpAcceptClientFunction mAcceptClientFunc;
|
||||
const ClientAcceptParam mClientAcceptParam;
|
||||
} TcpServerParam;
|
||||
|
|
31
utils/TcpModule/readme.md
Normal file
31
utils/TcpModule/readme.md
Normal file
|
@ -0,0 +1,31 @@
|
|||
# TCP模块
|
||||
这个项目实现了一个用于网络通信的TCP模块,提供了服务器和客户端功能。
|
||||
|
||||
# 涉及的知识
|
||||
* 网络通信
|
||||
* 多线程处理
|
||||
* 回调函数
|
||||
* C++/C
|
||||
* I/O多路复用
|
||||
* 套接字编程
|
||||
* TCP协议
|
||||
|
||||
# 各文件的作用
|
||||
* **TcpModule.h**:定义了TCP模块的公共接口和数据结构,包括服务器和客户端参数结构体、回调函数类型等。
|
||||
|
||||
* **TcpModule.cpp**:实现了TcpModule.h中定义的接口,包括创建和释放TCP服务器和客户端的函数。
|
||||
|
||||
* **ITcpClient.h/ITcpClient.cpp**:定义和实现了TCP客户端接口,包括初始化、读取数据、写入数据和关闭连接等虚函数。
|
||||
|
||||
* **ITcpServer.h/ITcpServer.cpp**:定义和实现了TCP服务器接口,包括初始化、关闭服务器等虚函数。
|
||||
|
||||
* **TcpClientImpl.h/TcpClientImpl.cpp**:实现了ITcpClient接口,是TCP客户端的具体实现。
|
||||
|
||||
* **TcpServerImpl.h/TcpServerImpl.cpp**:实现了ITcpServer接口,是TCP服务器的具体实现。
|
||||
|
||||
* **TcpModuleMakePtr.h/TcpModuleMakePtr.cpp**:提供了创建TCP服务器和客户端实例的工厂方法。
|
||||
|
||||
* **TcpServerHandle.h/TcpServerHandle.cpp**:管理TCP服务器的实例,提供了添加和获取服务器实例的方法。
|
||||
|
||||
* **TcpClientAcceptImpl.h/TcpClientAcceptImpl.cpp**:实现了ITcpClientAccept接口,处理客户端连接的接受和数据交换。
|
||||
|
Loading…
Reference in New Issue
Block a user