Esempio n. 1
0
 NodeApiExec.APIEXEC.Client getClient()
 {
     if (client == null)
     {
         client = Api.ClientFactory.CreateExecutorAPIClient(RemoteNodeIp, RemoteNodePort, RequestTimeout);
     }
     return(client);
 }
Esempio n. 2
0
        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);
        }