liuxiaolong
2021-01-08 8b4557280f9dbc2b33f6f7bbd4bb49d1ba7fc3b3
注册sendandrecv添加超时
2个文件已修改
4 ■■■■ 已修改文件
hbusc.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
micronode.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
hbusc.go
@@ -151,7 +151,7 @@
            }
            var rMsg []bhomebus.Mesg
            n := regSock.Sendandrecv(regAddr, msg, &rMsg) //n代表成功发送的节点的个数
            n := regSock.SendandrecvTimeout(regAddr, msg, &rMsg, handle.conf.sendTimeOut) //n代表成功发送的节点的个数
            handle.printLog("regSock.Sendandrecv n:", n, "len(rMsg):", len(rMsg))
            if n == 1 && len(rMsg) == 1 {
                var cr CommonReply
micronode.go
@@ -23,7 +23,7 @@
}
func NewMicroNode(ctx context.Context,q chan os.Signal, serverId string, reg *RegisterInfo, procInfo *ProcInfo,fnLog func(v ...interface{})) (*MicroNode, error){
    conf := NewConfig(KEY_REGISTER,512,5,10,10,100, fnLog)
    conf := NewConfig(KEY_REGISTER,512,5,100,100,100, fnLog)
    handle, err := Register(ctx, q, conf, reg)
    if err != nil {
        return nil, err