| | |
| | | |
| | | } |
| | | |
| | | func Cleanup() { |
| | | C.BHCleanup() |
| | | } |
| | | |
| | | type ServerCB func(src unsafe.Pointer, proc_id *string, req *bh.MsgRequestTopic) |
| | | type ClientCB func(proc_id *string, msg_id *[]byte, reply *bh.MsgRequestTopicReply) |
| | | type SubDataCB func(proc_id *string, pub *bh.MsgPublish) |
| | |
| | | proc := bh.ProcInfo{} |
| | | proc.ProcId = []byte(proc_id) |
| | | reply := bh.MsgCommonReply{} |
| | | defer Cleanup() |
| | | |
| | | StartWorker(ClientCallback, ServerCallback, SubDataCallback) |
| | | |
| | |
| | | fmt.Println("register ok") |
| | | } else { |
| | | fmt.Println("register failed") |
| | | t.Log("register error") |
| | | return |
| | | } |
| | | r = Unregister(&proc, &reply, 1000) |
| | |
| | | free(data); |
| | | } |
| | | |
| | | int BHCleanup() |
| | | { |
| | | ProcNode().Stop(); |
| | | } |
| | | |
| | | int BHGetLastError(void **msg, int *msg_len) |
| | | { |
| | | int ec = 0; |
| | |
| | | const void *reply, |
| | | const int reply_len); |
| | | |
| | | // int BHCleanUp(); |
| | | int BHCleanup(); |
| | | |
| | | void BHFree(void *buf, int size); |
| | | |