1
0
mirror of https://github.com/fumiama/simple-kanban.git synced 2026-06-08 18:10:24 +08:00
Files
simple-kanban/README.md
fumiama 6fc59db821 实现
2021-05-02 22:52:57 +08:00

62 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# simple-kanban
基于C语言Socket编程的简易公告发布程序
# 编译
仅适用于`unix`类系统,`windows`下编译请自行将`socket`实现替换为`winsock`
```bash
git clone https://github.com/fumiama/simple-kanban.git
cd simple-kanban
mkdir build
cd build
cmake ../
make
```
# 数据格式
1. 看板、数据的报文头部有固定的4字节用来标识之后数据的长度但回复串succ/erro/null/get/set无此头部。
2. PASSWORD、SETPASS位于`server.c`头部,可自行定义。
# 使用
0. 启动程序
```bash
./simple-kanban -d 7777 1 ./kanban.txt ./data.bin
```
1.`PASSWORD`连接连接后10秒无下一步操作自动断开
- 发送:`PASSWORD`字串
2. 获得看板
- 发送get
- 返回get
- 发送:版本号(一串数字)
- 返回:看板(有新消息)/`null`(无新消息)
3. 获得数据
- 发送cat
- 返回:数据
4. 设置看板
- 发送set
- 返回set
- 发送ver+`SETPASS`
- 返回data
- 发送:新的看板
- 返回succ
5. 设置数据
- 发送set
- 返回set
- 发送dat+`SETPASS`
- 返回data
- 发送:新的数据
- 返回succ