4 Commits

Author SHA1 Message Date
GL.iNet-Yongping.Xie 70c96a9d34 Fixed: fix ID conflicts BUG
prevent accidental removal of existing device on duplicate ID conflict
When a new device connection is established, it creates a Device struct and
checks for ID conflicts. If a conflict exists, the new device connection
closes and triggers DelDevice via its defer statement. The original
implementation used LoadAndDelete which removed any device with the given ID,
causing the existing device to be incorrectly removed.

This changes the deletion logic to use CompareAndDelete, which verifies
both the device ID and the specific device instance. Now when a duplicate
connection closes, only the new (unregistered) device is attempted for removal,
preserving the existing device in the registry.

This ensures legitimate devices remain connected when duplicate connection
attempts occur.

Signed-off-by: GL.iNet-Yongping.Xie <yongping.xie@gl-inet.com>
2025-08-14 00:09:49 -07:00
ClanXie 480844bfbc feat: build rtty docker images
build rtty docker images

Signed-off-by: GL.iNet-Yongping.Xie <yongping.xie@gl-inet.com>
2025-07-25 09:21:18 +00:00
Jianhui Zhao d1703f44cd add pprof performance profiling support
Add --pprof command line option to enable performance profiling

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-16 17:05:39 +08:00
Jianhui Zhao a0bfc21d11 Refactor the message distribution process
To solve a major problem: when there are many devices connected,
the broker will blocked in processing messages.

By the way, I've rewritten and reorganized the entire code architecture,
improved performance.

Some new features has been added:
* support device grouping.
* support show device's IP address.

Change-Id: I250e18091be7fd42028c82767b6edef50b3f6d8f
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
2025-07-07 12:21:36 +08:00