| | |
| | | "fmt" |
| | | "testing" |
| | | "time" |
| | | "unsafe" |
| | | ) |
| | | |
| | | func ServerCallback(src unsafe.Pointer, proc_id *string, req *bh.MsgRequestTopic) { |
| | | fmt.Println("user server cb called, request topic: " + string(req.Topic) + ", data:" + string(req.Data)) |
| | | reply := bh.MsgRequestTopicReply{} |
| | | reply.Data = []byte("reply 1234") |
| | | SendReply(src, &reply) |
| | | } |
| | | |
| | | func SubDataCallback(proc_id *string, pub *bh.MsgPublish) { |
| | | fmt.Println("user sub data cb called") |
| | | } |
| | | func ClientCallback(proc_id *string, msg_id *[]byte, reply *bh.MsgRequestTopicReply) { |
| | | fmt.Println("user client cb reply: " + string(reply.Data)) |
| | | } |
| | | func TestRegister(t *testing.T) { |
| | | proc_id := "test_proc" |
| | | proc := bh.ProcInfo{} |
| | |
| | | fmt.Println("register ok") |
| | | } else { |
| | | fmt.Println("register failed") |
| | | t.Log("register error") |
| | | return |
| | | } |
| | | |