From e2be46888935358144da5434a0a1ac9d82d588fb Mon Sep 17 00:00:00 2001
From: lichao <lichao@aiotlink.com>
Date: 星期三, 19 五月 2021 11:31:13 +0800
Subject: [PATCH] static link protobuf.
---
api/bhsgo/bhome_node_test.go | 6 +++---
api/bhsgo/bhome_node.go | 2 +-
src/CMakeLists.txt | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/api/bhsgo/bhome_node.go b/api/bhsgo/bhome_node.go
index 6a91f34..2cf3a81 100644
--- a/api/bhsgo/bhome_node.go
+++ b/api/bhsgo/bhome_node.go
@@ -4,7 +4,7 @@
#include "bh_api_go.h"
*/
-// #cgo LDFLAGS: -L/home/lichao/code/shmsg/build/lib -L/usr/local/lib -lbhome_shmq -lbhome_msg -lprotobuf-lite -lstdc++ -lpthread -lrt
+// #cgo LDFLAGS: -L/home/lichao/code/shmsg/build/lib -L/usr/local/lib -lbhome_shmq -lstdc++ -lpthread -lrt
import "C"
import (
diff --git a/api/bhsgo/bhome_node_test.go b/api/bhsgo/bhome_node_test.go
index d2720a3..756b752 100644
--- a/api/bhsgo/bhome_node_test.go
+++ b/api/bhsgo/bhome_node_test.go
@@ -29,8 +29,6 @@
reply := bh.MsgCommonReply{}
defer Cleanup()
- StartWorker(ClientCallback, ServerCallback, SubDataCallback)
-
r := Register(&proc, &reply, 1000)
if r {
fmt.Println("register ok")
@@ -53,6 +51,8 @@
t.Log("register error")
return
}
+
+ StartWorker(ClientCallback, ServerCallback, SubDataCallback)
r = HeartbeatEasy(1000)
if r {
@@ -81,7 +81,7 @@
pid := ""
rr := bh.MsgRequestTopicReply{}
dest := bh.BHAddress{}
- for i := 0; i < 10000; i++ {
+ for i := 0; i < 100; i++ {
if Request(&dest, &req, &pid, &rr, 3000) {
fmt.Println("server:" + pid + ", reply:" + string(rr.Data))
} else {
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3d74846..e04328d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -10,5 +10,5 @@
set(LogLibs "boost_log;boost_log_setup;boost_thread;boost_filesystem")
-target_link_libraries(${Target} bhome_msg ${LogLibs} pthread rt)
+target_link_libraries(${Target} bhome_msg_static ${LogLibs} pthread rt)
target_link_libraries(${TargetStatic} bhome_msg_static ${LogLibs} pthread rt)
--
Gitblit v1.8.0