node.js - node-red Mqtt,如何关闭套接字连接
问题描述
red-contrib-mqtt-broker` 作为 mqtt 代理。客户端的连接/断开连接正常,但在后端套接字没有立即关闭,因此套接字越来越堆积。它导致服务器停机。
请帮助我如何解决这个问题。
这是我的节点红色流程
[
{
"checkall": "false",
"id": "75e2813d.1200d",
"name": "chkTopic",
"outputs": 3,
"property": "topic",
"propertyType": "msg",
"repair": false,
"rules": [
{
"t": "eq",
"v": "clientConnected",
"vt": "str"
},
{
"t": "eq",
"v": "published",
"vt": "str"
},
{
"t": "eq",
"v": "clientDisconnected",
"vt": "str"
}
],
"type": "switch",
"wires": [
[
"e44d3fd.601fcc"
],
[
"b0cbe2f0.fdf51"
],
[
"352b1527.c0382a"
]
],
"x": 340,
"y": 120,
"z": "9207591e.000228"
},
{
"dburl": "",
"id": "169a1574.037e8b",
"mqtt_port": "6883",
"mqtt_ws_port": "6889",
"name": "Silsung ST Connector",
"password": "ajay1234",
"type": "mosca in",
"username": "admin",
"wires": [
[
"75e2813d.1200d"
]
],
"x": 140,
"y": 120,
"z": "9207591e.000228"
},
{
"active": true,
"complete": "payload",
"console": false,
"id": "b0cbe2f0.fdf51",
"name": "",
"tosidebar": true,
"tostatus": false,
"type": "debug",
"wires": [],
"x": 530,
"y": 120,
"z": "9207591e.000228"
},
{
"active": true,
"complete": "payload",
"console": false,
"id": "352b1527.c0382a",
"name": "",
"tosidebar": true,
"tostatus": false,
"type": "debug",
"wires": [],
"x": 530,
"y": 180,
"z": "9207591e.000228"
},
{
"active": true,
"complete": "payload",
"console": false,
"id": "e44d3fd.601fcc",
"name": "",
"tosidebar": true,
"tostatus": false,
"type": "debug",
"wires": [],
"x": 510,
"y": 60,
"z": "9207591e.000228"
}
]
解决方案
推荐阅读
- java - Jacoco 代码覆盖率:不存在的静态块仅显示 75% 的覆盖率
- reactjs - 在反应中从两个连接的 api 形成一个数组
- c - 从 CSV 文件中读取并分离字段以存储在 C 中的结构中
- c - 如何停止重复变量的值并捕获所有值?
- ruby - 在我使用零检查的地方优化打印输出。红宝石
- c++ - 如何检查里面有多少个 int 数字并将其重置为零?
- java - 如何在地图上创建线程
一直有效并从地图中删除密钥? - reactjs - 在条件下从组件中删除属性,reactjs
- vba - 扫描 VBA 中的列表并将每个命中添加到同一单元格中
- c# - 从数据库中删除所有数据后获取 DbUpdateConcurrencyException