TTransport transport = new TSocket("你的ip", 你的端口);
TProtocol protocol = new TBinaryProtocol(transport);
//创建 Thrift 客户端对象
xxService.Client client = new DeploymentService.Client(protocol);
transport.open();
client.method(参数);
很简单的代码,网上的都太复杂了,什么生成服务端,客户端。
不过这个的前提是你的thrift机器已经启动
或者直接使用xxxService.Iface