| | |
| | | #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 ( |
| | |
| | | reply := bh.MsgCommonReply{} |
| | | defer Cleanup() |
| | | |
| | | StartWorker(ClientCallback, ServerCallback, SubDataCallback) |
| | | |
| | | r := Register(&proc, &reply, 1000) |
| | | if r { |
| | | fmt.Println("register ok") |
| | |
| | | t.Log("register error") |
| | | return |
| | | } |
| | | |
| | | StartWorker(ClientCallback, ServerCallback, SubDataCallback) |
| | | |
| | | r = HeartbeatEasy(1000) |
| | | if r { |
| | |
| | | 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 { |
| | |
| | | |
| | | 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) |