1 Star 1 Fork 0

凡卡 / libp2parea

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
operation.go 782 Bytes
一键复制 编辑 原始数据 按行查看 历史
凡卡 提交于 2023-11-29 11:01 . first commit
package libp2parea
import (
"time"
"gitee.com/prestonTao/libp2parea/config"
"gitee.com/prestonTao/libp2parea/nodeStore"
"gitee.com/prestonTao/utils"
)
/*
* 获取指定节点的机器id
*
* @return machineID string 目标的机器id
*/
func (this *Area) GetNodeMachineID(recvid *nodeStore.AddressNet) string {
bs, ok, isSendSelf, err := this.MessageCenter.SendP2pMsgWaitRequest(config.MSGID_search_node, recvid, nil, time.Second*10)
if err != nil {
return ""
}
if isSendSelf || !ok {
return ""
}
// bs := flood.WaitRequest(config.CLASS_get_MachineID, hex.EncodeToString(message.Body.Hash), 0)
// bs, _ := flood.WaitRequest(config.CLASS_get_MachineID, utils.Bytes2string(message.Body.Hash), 0)
if bs == nil {
return ""
}
return utils.Bytes2string(*bs)
}
Go
1
https://gitee.com/prestonTao/libp2parea.git
git@gitee.com:prestonTao/libp2parea.git
prestonTao
libp2parea
libp2parea
master

搜索帮助