Skip to content

Commit b5e9c8c

Browse files
committed
添加应用设计
1 parent 6de075c commit b5e9c8c

File tree

5 files changed

+55
-0
lines changed

5 files changed

+55
-0
lines changed

src/CBus/CBus.slnx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Solution>
2+
<Folder Name="/Solution Items/">
3+
<File Path="README.md" />
4+
</Folder>
5+
<Folder Name="/src/">
6+
<Project Path="src/CBus/CBus.csproj" />
7+
</Folder>
8+
</Solution>

src/CBus/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# CBus
2+
3+
来自于 Linux 的 d-Bus 思想
4+
5+
提供一个中间平台层,可以给多个应用与服务之间建立联系
6+
7+
设计上全采用 HTTP 1.1 的结构,包括 Header 头和 Body 内容。其中 Header 头为 Key-Value 对。而 Body 则不加以限制,允许传入表单等格式的内容,甚至直接二进制内容返回
8+
9+
## 连接方式
10+
11+
CBus 支持两种连接方式:
12+
13+
- HTTP: 标准 HTTP 用法。内置证书,支持 HTTPS 方式连接
14+
- Pipe: 本机 IPC 常用的管道。管道传输内容为 HTTP 1.1 的数据格式
15+
16+
细节设计如下:
17+
18+
内置约定 3323 为通讯端口,会在启动时在本机文件夹和注册表(仅 Windows 平台) 写入监听的端口号,供其他应用查询使用
19+
20+
## 通讯细节
21+
22+
服务 <===> CBus <===> 客户端
23+
24+
### 面向服务
25+
26+
服务启动的时候,先向 CBus 执行注册。注册动作为在指定文件夹写入此服务的配置文件

src/CBus/src/CBus/CBus.csproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net10.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
</PropertyGroup>
8+
9+
</Project>

src/CBus/src/CBus/HttpConnector.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace CBus;
2+
3+
public class HttpConnector
4+
{
5+
6+
}

src/CBus/src/CBus/PipeConnector.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace CBus;
2+
3+
public class PipeConnector
4+
{
5+
6+
}

0 commit comments

Comments
 (0)