Skip to content

Commit e6d35b0

Browse files
committed
test[net]: protocol config test
1 parent c380149 commit e6d35b0

1 file changed

Lines changed: 11 additions & 12 deletions

File tree

net/src/test/resources/protocol.xml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,21 @@
33
<!-- native为内部消息,common是公共消息每个模块都能使用,js是web通信用的协议会生成js协议文件 -->
44
<protocols>
55

6+
<!-- 配置包名称,会扫描包底下所有被@Protocol注解标注的协议 -->
67
<module id="1" name="native">
7-
<protocol location="com.zfoo.net.router.attachment.SignalAttachment"/>
8-
<protocol location="com.zfoo.net.router.attachment.GatewayAttachment"/>
9-
<protocol location="com.zfoo.net.router.attachment.UdpAttachment"/>
10-
<protocol location="com.zfoo.net.router.attachment.HttpAttachment"/>
11-
<protocol location="com.zfoo.net.router.attachment.NoAnswerAttachment"/>
8+
<protocol location="com.zfoo.net.router.attachment"/>
129
</module>
1310

14-
<!-- 在xml文件中写协议号是为了统一规划协议号,更加直观;不写协议号也没有影响 -->
11+
<!-- 在xml文件中写协议号是为了统一规划协议号,更加直观 -->
1512
<module id="2" name="common">
16-
<protocol id="100" location="com.zfoo.net.packet.common.Message"/>
17-
<protocol id="101" location="com.zfoo.net.packet.common.Error"/>
18-
<protocol id="102" location="com.zfoo.net.packet.common.Heartbeat"/>
19-
<protocol id="103" location="com.zfoo.net.packet.common.Ping"/>
20-
<protocol id="104" location="com.zfoo.net.packet.common.Pong"/>
21-
13+
<!-- 不写协议号,会使用协议里的@Protocol注解的id当做协议号 -->
14+
<protocol location="com.zfoo.net.packet.common.Message"/>
15+
<protocol location="com.zfoo.net.packet.common.Error"/>
16+
<protocol location="com.zfoo.net.packet.common.Heartbeat"/>
17+
<protocol location="com.zfoo.net.packet.common.Ping"/>
18+
<protocol location="com.zfoo.net.packet.common.Pong"/>
19+
20+
<!-- 写协议号更加直观,必须和协议里的@Protocol注解的id相等 -->
2221
<protocol id="110" location="com.zfoo.net.packet.common.PairIntLong"/>
2322
<protocol id="111" location="com.zfoo.net.packet.common.PairLong"/>
2423
<protocol id="112" location="com.zfoo.net.packet.common.PairString"/>

0 commit comments

Comments
 (0)