File tree Expand file tree Collapse file tree 4 files changed +40
-12
lines changed Expand file tree Collapse file tree 4 files changed +40
-12
lines changed Original file line number Diff line number Diff line change 1
1
* MQTT Coroutine Client
2
- * [ Client API] ( en/client )
3
-
4
- * MQTT Server
5
- * [ Message API] ( en/message )
2
+ * [ Client API] ( en/client )
6
3
7
4
* MQTT Protocol Analysis
8
- * [ Protocol API] ( en/protocol )
5
+ * [ Protocol API] ( en/protocol )
6
+
7
+ * MQTT Message
8
+ * [ Message API] ( en/message )
9
9
10
10
* Upgrade Guide
11
11
* [ 1.2 Upgrade Guide] ( en/upgrade/1.2.md )
Original file line number Diff line number Diff line change 1
1
# Message API
2
2
3
- It is mainly convenient for replying to the ACK on the other side in the Server.
3
+ It is mainly convenient for replying to the ACK on the other side in the Server/Client .
4
4
5
5
## Usage examples
6
6
@@ -30,3 +30,17 @@ $ack->setProtocolLevel(ProtocolInterface::MQTT_PROTOCOL_LEVEL_5_0)
30
30
$ack_data = $ack->getContents();
31
31
$ack_data = (string) $ack;
32
32
```
33
+
34
+ ### Server
35
+
36
+ ``` php
37
+ $server->send($fd, $ack->getContents());
38
+ $server->send($fd, (string) $ack);
39
+ ```
40
+
41
+ ### Client
42
+
43
+ ``` php
44
+ // Add param to get an array
45
+ $client->send($ack->getContents(true), false);
46
+ ```
Original file line number Diff line number Diff line change 1
1
* MQTT 协程客户端
2
- * [ Client API] ( zh-cn/client )
3
-
4
- * MQTT Server
5
- * [ Message API] ( zh-cn/message )
2
+ * [ Client API] ( zh-cn/client )
6
3
7
4
* MQTT 协议解析
8
- * [ Protocol API] ( zh-cn/protocol )
5
+ * [ Protocol API] ( zh-cn/protocol )
6
+
7
+ * MQTT Message
8
+ * [ Message API] ( zh-cn/message )
9
9
10
10
* 版本升级指南
11
11
* [ 1.2 升级指南] ( zh-cn/upgrade/1.2.md )
Original file line number Diff line number Diff line change 1
1
# Message API
2
2
3
- 主要方便用于在 Server 中回复对端 ACK。
3
+ 主要方便用于在 Server/Client 中回复对端 ACK。
4
4
5
5
## 使用示例
6
6
@@ -30,3 +30,17 @@ $ack->setProtocolLevel(ProtocolInterface::MQTT_PROTOCOL_LEVEL_5_0)
30
30
$ack_data = $ack->getContents();
31
31
$ack_data = (string) $ack;
32
32
```
33
+
34
+ ### Server
35
+
36
+ ``` php
37
+ $server->send($fd, $ack->getContents());
38
+ $server->send($fd, (string) $ack);
39
+ ```
40
+
41
+ ### Client
42
+
43
+ ``` php
44
+ // 增加参数来获取数组
45
+ $client->send($ack->getContents(true), false);
46
+ ```
You can’t perform that action at this time.
0 commit comments