| | |
| | | proc_id := "test_proc" |
| | | proc := bh.ProcInfo{} |
| | | proc.ProcId = []byte(proc_id) |
| | | fmt.Println("proc id: ", proc.ProcId) |
| | | reply := bh.MsgCommonReply{} |
| | | defer Cleanup() |
| | | |
| | |
| | | } else { |
| | | fmt.Println("reg topics failed") |
| | | } |
| | | |
| | | req := bh.MsgRequestTopic{} |
| | | time.Sleep(time.Second * 1) |
| | | req.Topic = []byte("topic0") |
| | |
| | | pid := "" |
| | | rr := bh.MsgRequestTopicReply{} |
| | | dest := bh.BHAddress{} |
| | | for i := 0; i < 100; i++ { |
| | | |
| | | queryProc := bh.MsgQueryProc{} |
| | | queryReply := bh.MsgQueryProcReply{} |
| | | |
| | | QueryProcs(&dest, &queryProc, &queryReply, 3000) |
| | | fmt.Println("query result:", string(queryReply.ProcList[0].Proc.ProcId)) |
| | | |
| | | for i := 0; i < 10; i++ { |
| | | if Request(&dest, &req, &pid, &rr, 3000) { |
| | | fmt.Println("server:" + pid + ", reply:" + string(rr.Data)) |
| | | } else { |