feat: 接线 serve 真实 auth/注册/管理/MQTT 与消息循环

This commit is contained in:
Nixevol
2026-09-30 07:56:25 +08:00
parent 550ed534e4
commit 0efcfbb8b6
9 changed files with 699 additions and 80 deletions
+10
View File
@@ -159,6 +159,16 @@ func (h *nixHook) OnSubscribed(cl *mqtt.Client, pk packets.Packet, reasonCodes [
func (h *nixHook) OnPublishDropped(cl *mqtt.Client, pk packets.Packet) {
h.b.log.Debug("publish dropped", "client", cl.ID, "topic", pk.TopicName, "size", len(pk.Payload))
if h.b.onDrop == nil {
return
}
h.b.connsMu.RLock()
st := h.b.byClient[cl]
h.b.connsMu.RUnlock()
if st == nil {
return
}
h.b.onDrop(context.Background(), st.endpointID, st.connID, append([]byte(nil), pk.Payload...))
}
func (h *nixHook) OnSessionEstablished(cl *mqtt.Client, _ packets.Packet) {