From 6a1b64b8b2933d5bc38a6084ff06cccda35110b7 Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期一, 18 一月 2021 18:43:26 +0800
Subject: [PATCH] pub消息返回值大于0表示发布成功
---
hbusc.go | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/hbusc.go b/hbusc.go
index 61f893b..958d74e 100644
--- a/hbusc.go
+++ b/hbusc.go
@@ -502,7 +502,7 @@
func (h *BHBus) Pub(nodes []bhomebus.NetNode, msg *MsgInfo) error {
data,err := json.Marshal(*msg)
if err == nil {
- if n := h.sockPub.sock.PubTimeout(nodes, msg.Topic, data, h.conf.pubTimeOut);n == 0 {
+ if n := h.sockPub.sock.PubTimeout(nodes, msg.Topic, data, h.conf.pubTimeOut);n > 0 {
return nil
} else {
return fmt.Errorf("pub err n:%d", n)
--
Gitblit v1.8.0