lpt
2025-07-30 7c0f9b58ab5c7ae5f157c4d1a55e31c4d911c021
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef STRUCT_DATA_H
#define STRUCT_DATA_H
#include <mutex>
#include <condition_variable>
enum TypeInfo{
    UPLOAD_REQ = 100,
    HEAD_UPLOAD_REQ,
    DATA_UPLOAD_REQ,
    UP_LOAD_FIN,
    UPLOAD_SQL_REQ,
    RELEASE_SQL_REQ,
    RELEASE_SQL_RES,
    HEART_CHECK_REQ,
    HEART_CHECK_RES
};
// 消息头
struct Head{
    int len;
    short type;
};
 
// 文件头
struct UpLoadPkgHead{
    Head head;
    int upLoadType;
    int fileNameLen;
    char fileName[0];
};
 
// 文件数据
struct UpLoadPkgData{
    Head head;
    int upLoadType;
    int fileNameLen;
    int dataLen;
    int flag;
    char data[0];
};
// 传输结束
struct UpLoadPkgFin{
    Head head;
    int upLoadType;
    int fileNameLen;
    int verSionLen;
    int cnt;
    char fileName[0];
};
 
// SQL结构体
struct SQLData{
 
 
 
};
struct SQLPkg{
    Head head;
 
};
struct ReleaseReq {
    Head head;
    ReleaseReq(){
        head.len = sizeof(ReleaseReq);
        head.type = RELEASE_SQL_REQ;
    }
};
struct HeartCheckReq  // 心跳请求包
{
    Head head;
    HeartCheckReq()
    {
        head.type = HEART_CHECK_REQ;
        head.len = sizeof(HeartCheckReq);
    }
};
 
struct HeartCheckRes  // 心跳响应包
{
    Head head;
    HeartCheckRes()
    {
        head.type = HEART_CHECK_RES;
        head.len = sizeof(HeartCheckRes);
    }
};
 
#endif // STRUCT_DATA_H