// This autogenerated skeleton file illustrates how to build a server.// You should copy it to another filename to avoid overwriting it.#include <iostream>#include <thrift/protocol/TBinaryProtocol.h>#include <thrift/transport/TSocket.h>#include <thrift/transport/TTransportUtils.h>#include "HelloWordService_types.h"#include "HelloWordService.h"using namespace ::apache::thrift;using namespace ::apache::thrift::protocol;using namespace ::apache::thrift::transport;using boost::shared_ptr;int main(int argc, char **argv) {//boost::shared_ptr<TTransport> socket(new TSocket("192.168.10.174", 9090));//boost::shared_ptr<TTransport> socket(new TSocket("192.168.10.174", 9090));boost::shared_ptr<TTransport> socket(new TSocket("192.168.10.35", 9090));boost::shared_ptr<TTransport> transport(new TBufferedTransport(socket));boost::shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport));HelloWordServiceClient client(protocol);transport->open();std::string return_value;Request request;request.__set_type(RequestType::SAY_HELLO);//request.__set_name("Coing");request.name = "Coing";request.__set_age(24);client.doAction(return_value, request);printf("111return value : %s \n", return_value.c_str());request.__set_type(RequestType::QUERY_TIME);request.name = "hill";client.doAction(return_value, request);printf("222return value : %s \n", return_value.c_str());transport->close();return 0;}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。