mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-03 22:45:13 +08:00
新增判断连接状态接口
This commit is contained in:
@@ -145,3 +145,8 @@ func GetRpcClient(nodeId int,serviceMethod string) ([]*rpc.Client,error) {
|
||||
func GetRpcServer() *rpc.Server{
|
||||
return &cluster.rpcServer
|
||||
}
|
||||
|
||||
func (slf *Cluster) IsNodeConnected (nodeId int) bool {
|
||||
pClient := slf.GetRpcClient(nodeId)
|
||||
return pClient!=nil && pClient.IsConnected()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user