NodeApiExec.APIEXEC.Client getClient() { if (client == null) { client = Api.ClientFactory.CreateExecutorAPIClient(RemoteNodeIp, RemoteNodePort, RequestTimeout); } return(client); }
public static NodeApiExec.APIEXEC.Client CreateExecutorAPIClient(string networkIp, int port, int timeout) { var socket = new TSocket(networkIp, port, timeout); TBinaryProtocol tr = new TBinaryProtocol(socket); var client = new NodeApiExec.APIEXEC.Client(tr); try { socket.Open(); } catch (Exception x) { throw new CreateClientFailedException($"Failed to connect to {networkIp}:{port}, host unreachable?", x); } return(client); }