Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bitactor/bitactor-core
Bitactor Core 是一款Java 网络服务框架
https://github.com/bitactor/bitactor-core
net netty rpc
Last synced: 7 days ago
JSON representation
Bitactor Core 是一款Java 网络服务框架
- Host: GitHub
- URL: https://github.com/bitactor/bitactor-core
- Owner: Bitactor
- License: apache-2.0
- Created: 2021-03-08T06:48:55.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-01-18T06:06:41.000Z (about 3 years ago)
- Last Synced: 2024-11-28T23:23:44.426Z (2 months ago)
- Topics: net, netty, rpc
- Language: Java
- Homepage:
- Size: 283 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bitactor-core
[![JDK](https://img.shields.io/badge/JDK-1.8%2B-green.svg)](https://www.oracle.com/technetwork/java/javase/downloads/index.html)
[![license](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0)### 介绍
Bitactor Core 是一款Java 网络服务框架
### bitactor协议#### 支持的协议
* TCP : 常规的长连接协议
* KCP : [可靠的UDP协议](https://github.com/szhnet/kcp-netty)
* WS : Websocket#### Bitactor协议格式
通用
| head | packetType |
|:---------|:-----------|
| 2(short) | 1(byte) |MessageData 专有
| head | packetType | protoType | msgId | commandId | data |
|:---------|:-----------|:----------|:-------|:----------|:--------|
| 2(short) | 1(byte) | 1(byte) | 4(int) | 4(int) | n(byte) |#### 协议名词解释
| 参数名 | 名词 | 解释 |
|:---------|:---------|:----------------------------------------------------------------|
|head | 包头 |指定包体长度,不包括head的长度。 |
|protoType | 包类型 | 包类型 协议包类型。 |
|protoType | 协议类型 | 指定序列化类型,支持Protobuf/Json。 |
|msgId | 消息号 | 单次请求响应消息号相同,每增加一次请求消息号+1,推送消息的msg固定为0。 |
|commandId | 协议解析id| 序列化类的简单类名的hashCode值,用于序列化&反序列化(也可自定义) |
|data | 数据内容 | Protobuf/Json的 序列化类的byte[] |#### bitactor协议包类型
基于packetType协议包体分为5种
| 包类名 | packetType值 | 描述 |
|:-----------------|:-------------|:--------|
| MessageHandShake | 0x01 | 握手消息 |
| MessageAck | 0x02 | 确认消息 |
| MessageHeartBeat | 0x03 | 心跳消息 |
| MessageData | 0x04 | 数据消息 |
| MessageClose | 0x10 | 关闭消息 |